2026-05-03 21:44 UTC
@Myndex@techhub.social 1 - 0.63 = 0.37, so one of us is inverted
Replies (1)
-
@Myndex@techhub.social 2026-05-03 21:57
@adamhotep@infosec.exchange I think I just realized... did you linearize first? The reality is that before the coefficients are applied, the R G B tuples need to be linearized (gamma or TRC removed), otherwise, you won't get the correct luminance value... that could explain why your flip point seems inverted... The sRGB piecewise TRC is "official" but a 2.2 gamma works: ``` let Y = (sR/255.0)**2.2*0.2126+(sG/255.0)**2.2*0.7152+(sB/255.0)**2.2*0.0722 ; let text = Y > 0.37 ? "#000" : "#fff" ; ```