Closed blueberrymuffin3 closed 2 years ago
Useful resource on sRGB and gamma: https://blog.johnnovak.net/2016/09/21/what-every-coder-should-know-about-gamma/
My formulas seem to be producing incorrect results: I calculated a color of 0xd5ecf3
, very similar (probably different due to sRGB's linear section) to an online converter's #d7edf4
. However, a screenshot of osu! shows the value #ddffff
?
Linear value from osu-framework's Color4.LightBlue:
Color calculated w/ simple 2.2 gamma:
Color from screenshot (song progress bar):
I'm not sure if some kind of filter is being applied within osu!lazer, but I can't find one.
According to this formula from osu-framework, the value should be #d7edf4
.
The color is overridden with OsuColors.BlueLighter
(#ddffff
)🤦
In osu-framework, Color4 stores linear RGB colors. However Pixi.js's tint values appear to use sRGB. Opacity/alpha seems to be done in the opposite way, being gamma corrected in osu-framework, but not in PIXI.js.
To convert a color from osu-framework to PIXI.js, take each RGB component to the
1/2.2
power and use that for tint. Take the opacity to the2.2
(NOT1/2.2
) power and use that for alpha.I'm not sure how this affects combo colors, but at the very least these is incorrect.
I am not sure if this affect storyboard
C
andF
commands.