jfairbank / chroma

Ruby gem for color manipulation and palette generation
ISC License
234 stars 29 forks source link

Brightness - sqrt(red^2 * 0.299 + green^2 * 0.587 + blue^2 * 0.114) #31

Open Laykou opened 3 years ago

Laykou commented 3 years ago

According to this https://www.atlantbh.com/how_to_detect_colour_brightness_in_ruby/ ​brightness should be calculated as

sqre(red^2 * 0.299 + green^2 * 0.587 +  blue^2 * 0.114)

rather than

red * 0.299 + green * 0.587 +  blue * 0.114

Why does this gem use a different formula?