Formula to determine brightness of RGB color

前端 未结 20 3394
猫巷女王i
猫巷女王i 2020-11-21 23:16

I\'m looking for some kind of formula or algorithm to determine the brightness of a color given the RGB values. I know it can\'t be as simple as adding the RGB values toget

20条回答
  •  日久生厌
    2020-11-21 23:40

    The HSV colorspace should do the trick, see the wikipedia article depending on the language you're working in you may get a library conversion .

    H is hue which is a numerical value for the color (i.e. red, green...)

    S is the saturation of the color, i.e. how 'intense' it is

    V is the 'brightness' of the color.

提交回复
热议问题