bagginsbill opened this issue on Oct 29, 2008 · 247 posts
kobaltkween posted Thu, 03 December 2009 at 4:46 AM
well, i seem to have something that might work
def asRGB(x):
ifMask = Color_Step(x, 12.92 * 0.0031308)
xFalse = 1 - ifMask) * x
xTrue = ifMask* x
return xFalse / Add(12.92, 0) + ((xTrue + .055) / Add(1.055, 0)) ** Add(2.4, 0)
def sRGB(x):
ifMask = Color_Step (x, 0.0031308)
xFalse = (1 - ifMask) * x
xTrue = ifMask* x
return Add(12.92, 0) * xFalse + (Add(1.055, 0) * (xTrue ** (1/2.4))) - .055
edited to reverse the mask because i'm really not swift at this and easily turned around