You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It looks strange because of HTML color spec and because lighten is a relative process.
First, HTML "red" and "blue" are both pure colors to start with (255 for one value and 0 for the others). HTML "green" is strangely only half brightness (128 for green, 0 for the others). If you were to use "lime" instead, you would get the values you want!
For more info on the lighten function being a relative process, see #53. Passing one basically doubles the brightness of the current value. Since "green" is half-bright, it takes that value up to 255 ("lime"). If you were to run (new Colour('green')).lighten(1).lighten(1).rgb() - you would also get the results you were expecting.
(new Colour('red')).lighten(1).rgb()
Object {r: 255, g: 255, b: 255}
(new Colour('blue')).lighten(1).rgb()
Object {r: 255, g: 255, b: 255}
(new Colour('green')).lighten(1).rgb()
Object {r: 0, g: 255, b: 0}
The text was updated successfully, but these errors were encountered: