Formula to determine brightness of RGB color

前端 未结 20 3111
猫巷女王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:55

    Interestingly, this formulation for RGB=>HSV just uses v=MAX3(r,g,b). In other words, you can use the maximum of (r,g,b) as the V in HSV.

    I checked and on page 575 of Hearn & Baker this is how they compute "Value" as well.

    From Hearn&Baker pg 319

提交回复
热议问题