Quantcast
Channel: Rainmeter Forums
Viewing all articles
Browse latest Browse all 1609

Utilities and Tools • Re: Lua for Oklch

$
0
0
Very nice, excellent work for one of the more 'exotic' color spaces - the skin looks great too, thanks for sharing! :thumbup:
Apart from maybe the color shifting, I was surprised to see how much work in terms of code length you put into the multiple .lua scripts, given that I replicated what Colorizer does (i.e. converting between 8 color spaces, cause Munsell is just too overkill besides being proprietary) in a single page of .lua code (I cheated a bit using one liners and 2 char named variables, but still).

Code:

-- TODO:-- - set YRB aka YPrPb to use the BT.709 coefficients instead of the BT.601 ones (use the BT.601 ones for JPEG?)-- - store the attributes and their intervals in Lua and not in Rainmeter-- - change the division to 0 conventions for the conversion between x7y7L7 aka xyY and X6Y6Z6 aka XYZ to yield either 0, 1 or the white point?-- - adjust the x7y7L7 aka xyY gradient to not transition from the "black" left edge and instead start the gradient from 0.01 with 0.00 a "black" hard stop-- - clamp / cap out of bounds attribute values for most (all?) the attributes-- - round values in Rnd() before formatting them in Fmt()-- - avoid repeating entire conversion lines by using base XYZ2...() and RGB2...() functions for conversions to derived color spaces-- - set interval maximums for X6Y6Z6 aka XYZ to D65: 95.047, 100.000, 108.883function Initialize()  R1,G1,B1,H2,S2,V2,H3,S3,L3,C4,M4,Y4,K4,Y5,R5,B5,X6,Y6,Z6,x7,y7,L7,L8,A8,B8,H9,V9,C9 = SKIN:GetVariable('R1','0'),SKIN:GetVariable('G1','0'),SKIN:GetVariable('B1','0'),SKIN:GetVariable('H2','0'),SKIN:GetVariable('S2','0'),       SKIN:GetVariable('V2','0'),SKIN:GetVariable('H3','0'),SKIN:GetVariable('S3','0'),SKIN:GetVariable('L3','0'),SKIN:GetVariable('C4','0'),SKIN:GetVariable('M4','0'),SKIN:GetVariable('Y4','0'),SKIN:GetVariable('K4','0'),       SKIN:GetVariable('Y5','0'),SKIN:GetVariable('R5','0'),SKIN:GetVariable('B5','0'),SKIN:GetVariable('X6','0'),SKIN:GetVariable('Y6','0'),SKIN:GetVariable('Z6','0'),SKIN:GetVariable('x7','0'),SKIN:GetVariable('y7','0'),       SKIN:GetVariable('L7','0'),SKIN:GetVariable('L8','0'),SKIN:GetVariable('a8','0'),SKIN:GetVariable('b8','0'),SKIN:GetVariable('H9','0'),SKIN:GetVariable('V9','0'),SKIN:GetVariable('C9','0')  decimalargidx = {4, 4, 4, 5, 4, 4, 4, 4, 4}; Att(1, R1 and R1 / 255, G1 and G1 / 255, B1 and B1 / 255, 2)endfunction Idx(s, o, f) local I = {}; for i in (s or SKIN:GetVariable('CURRENTSECTION')):gmatch('%d+') do I[#I+1] = i end; return tostring(SKIN:ParseFormula((f or 'i'):gsub('i', I[o or #I] or '0'))) or '0' endfunction Rnd(...) local a = {}; for i = 1, #arg - 1 do a[i] = (arg[i] < 0 and math.ceil(arg[i] * 10 ^ arg[#arg] - 0.5) or math.floor(arg[i] * 10 ^ arg[#arg] + 0.5)) / 10 ^ arg[#arg] end; return unpack(a) endfunction Fmt(...) local a = {}; for i = 1, #arg - 1 do a[i] = string.format("%." .. arg[#arg] .. "f", arg[i]) end; return unpack(a) endfunction Att(s, ...)  local tR1,tG1,tB1,tH2,tS2,tV2,tH3,tS3,tL3,tC4,tM4,tY4,tK4,tY5,tR5,tB5,tX6,tY6,tZ6,tx7,ty7,tL7,tL8,ta8,tb8,tH9,tV9,tC9 = R1,G1,B1,H2,S2,V2,H3,S3,L3,C4,M4,Y4,K4,Y5,R5,B5,X6,Y6,Z6,x7,y7,L7,L8,a8,b8,H9,V9,C9  if     s == 1  then B1, G1, R1 = arg[3], arg[2], arg[1]; local X0, x0 = math.max(R1, G1, B1), math.min(R1, G1, B1); local C0 = X0 - x0  --[[RGB2HSV]]  V2 = X0; S2 = (V2 == 0 and 0 or C0 / V2); H2 = (C0 == 0 and 0 or (V2 == R1 and (G1 - B1) / C0 % 6 or (V2 == G1 and (B1 - R1) / C0 + 2 or (V2 == B1 and (R1 - G1) / C0 + 4 or 0)))) / 6  --[[RGB2HSL]]  L3 = (X0 + x0) / 2; S3 = ((L3 == 0 or L3 == 1) and 0 or (V2 - L3) / math.min(L3, 1 - L3)); H3 = H2; local h0 = function (n0) return (n0 > 0.04045 and ((n0 + 0.055) / 1.055) ^ 2.4 or n0 / 12.92) end  --[[RGB2CMYK]] K4 = 1 - X0; Y4 = (K4 == 1 and 0 or (1 - B1 - K4) / (1 - K4)); M4 = (K4 == 1 and 0 or (1 - G1 - K4) / (1 - K4)); C4 = (K4 == 1 and 0 or (1 - R1 - K4) / (1 - K4))  --[[RGB2YRB]]  Y5 = R1 * 0.299 + G1 * 0.587 + B1 * 0.114; B5 = (B1 - Y5) / 1.772; R5 = (R1 - Y5) / 1.402; local v0 = function (t0) return (t0 > (24 / 116) ^ 3 and t0 ^ (1 / 3) or t0 / (3 * (24 / 116) ^ 2) + 16 / 116) end  --[[RGB2XYZ]]  Z6 = h0(R1) * 0.0193 + h0(G1) * 0.1192 + h0(B1) * 0.9505; Y6 = h0(R1) * 0.2126 + h0(G1) * 0.7152 + h0(B1) * 0.0722; X6 = h0(R1) * 0.4124 + h0(G1) * 0.3576 + h0(B1) * 0.1805  --[[RGB2xyL]]  L7 = Y6; y7 = (X6 + Y6 + Z6 == 0 and 0 or Y6 / (X6 + Y6 + Z6)); x7 = (X6 + Y6 + Z6 == 0 and 0 or X6 / (X6 + Y6 + Z6))  --[[RGB2Lab]]  b8 = 200 * (v0(Y6 / 1.00000) - v0(Z6 / 1.08883)); a8 = 500 * (v0(X6 / 0.95047) - v0(Y6 / 1.00000)); L8 = 116 * v0(Y6 / 1.00000) - 16  elseif s == 2  then V2, S2, H2 = arg[3], arg[2], arg[1]; local f0 = function (n0) local k0 = (n0 + H2 * 6) % 6; return V2 - V2 * S2 * math.max(0, math.min(k0, 4 - k0, 1)) end  --[[HSV2RGB]]  B1 = f0(1); G1 = f0(3); R1 = f0(5)  --[[HSV2HSL]]  L3 = V2 * (1 - S2 / 2); S3 = ((L3 == 0 or L3 == 1) and 0 or (V2 - L3) / math.min(L3, 1 - L3)); H3 = H2; local h0 = function (n0) return (n0 > 0.04045 and ((n0 + 0.055) / 1.055) ^ 2.4 or n0 / 12.92) end  --[[HSV2CMYK]] K4 = 1 - math.max(R1, G1, B1); Y4 = (K4 == 1 and 0 or (1 - B1 - K4) / (1 - K4)); M4 = (K4 == 1 and 0 or (1 - G1 - K4) / (1 - K4)); C4 = (K4 == 1 and 0 or (1 - R1 - K4) / (1 - K4))  --[[HSV2YRB]]  Y5 = R1 * 0.299 + G1 * 0.587 + B1 * 0.114; B5 = (B1 - Y5) / 1.772; R5 = (R1 - Y5) / 1.402; local v0 = function (t0) return (t0 > (24 / 116) ^ 3 and t0 ^ (1 / 3) or t0 / (3 * (24 / 116) ^ 2) + 16 / 116) end  --[[HSV2XYZ]]  Z6 = h0(R1) * 0.0193 + h0(G1) * 0.1192 + h0(B1) * 0.9505; Y6 = h0(R1) * 0.2126 + h0(G1) * 0.7152 + h0(B1) * 0.0722; X6 = h0(R1) * 0.4124 + h0(G1) * 0.3576 + h0(B1) * 0.1805  --[[HSV2xyL]]  L7 = Y6; y7 = (X6 + Y6 + Z6 == 0 and 0 or Y6 / (X6 + Y6 + Z6)); x7 = (X6 + Y6 + Z6 == 0 and 0 or X6 / (X6 + Y6 + Z6))  --[[HSV2Lab]]  b8 = 200 * (v0(Y6 / 1.00000) - v0(Z6 / 1.08883)); a8 = 500 * (v0(X6 / 0.95047) - v0(Y6 / 1.00000)); L8 = 116 * v0(Y6 / 1.00000) - 16  elseif s == 3  then L3, S3, H3 = arg[3], arg[2], arg[1]; local f0 = function (n0) local k0, a0 = (n0 + H3 * 12) % 12, S3 * math.min(L3, 1 - L3); return L3 - a0 * math.max(-1, math.min(k0 - 3, 9 - k0, 1)) end  --[[HSL2RGB]]  B1 = f0(4); G1 = f0(8); R1 = f0(0)  --[[HSL2HSV]]  V2 = L3 + S3 * math.min(L3, 1 - L3); S2 = (V2 == 0 and 0 or 2 * (1 - L3 / V2)); H2 = H3; local h0 = function (n0) return (n0 > 0.04045 and ((n0 + 0.055) / 1.055) ^ 2.4 or n0 / 12.92) end  --[[HSL2CMYK]] K4 = 1 - math.max(R1, G1, B1); Y4 = (K4 == 1 and 0 or (1 - B1 - K4) / (1 - K4)); M4 = (K4 == 1 and 0 or (1 - G1 - K4) / (1 - K4)); C4 = (K4 == 1 and 0 or (1 - R1 - K4) / (1 - K4))  --[[HSL2YRB]]  Y5 = R1 * 0.299 + G1 * 0.587 + B1 * 0.114; B5 = (B1 - Y5) / 1.772; R5 = (R1 - Y5) / 1.402; local v0 = function (t0) return (t0 > (24 / 116) ^ 3 and t0 ^ (1 / 3) or t0 / (3 * (24 / 116) ^ 2) + 16 / 116) end  --[[HSL2XYZ]]  Z6 = h0(R1) * 0.0193 + h0(G1) * 0.1192 + h0(B1) * 0.9505; Y6 = h0(R1) * 0.2126 + h0(G1) * 0.7152 + h0(B1) * 0.0722; X6 = h0(R1) * 0.4124 + h0(G1) * 0.3576 + h0(B1) * 0.1805  --[[HSL2xyL]]  L7 = Y6; y7 = (X6 + Y6 + Z6 == 0 and 0 or Y6 / (X6 + Y6 + Z6)); x7 = (X6 + Y6 + Z6 == 0 and 0 or X6 / (X6 + Y6 + Z6))  --[[HSL2Lab]]  b8 = 200 * (v0(Y6 / 1.00000) - v0(Z6 / 1.08883)); a8 = 500 * (v0(X6 / 0.95047) - v0(Y6 / 1.00000)); L8 = 116 * v0(Y6 / 1.00000) - 16  elseif s == 4  then K4, Y4, M4, C4 = arg[4], arg[3], arg[2], arg[1]  --[[CMYK2RGB]] B1 = (1 - Y4) * (1 - K4); G1 = (1 - M4) * (1 - K4); R1 = (1 - C4) * (1 - K4); local X0, x0 = math.max(R1, G1, B1), math.min(R1, G1, B1); local C0 = X0 - x0  --[[CMYK2HSV]] V2 = X0; S2 = (V2 == 0 and 0 or C0 / V2); H2 = (C0 == 0 and 0 or (V2 == R1 and (G1 - B1) / C0 % 6 or (V2 == G1 and (B1 - R1) / C0 + 2 or (V2 == B1 and (R1 - G1) / C0 + 4 or 0)))) / 6  --[[CMYK2HSL]] L3 = (X0 + x0) / 2; S3 = ((L3 == 0 or L3 == 1) and 0 or (V2 - L3) / math.min(L3, 1 - L3)); H3 = H2; local h0 = function (n0) return (n0 > 0.04045 and ((n0 + 0.055) / 1.055) ^ 2.4 or n0 / 12.92) end  --[[CMYK2YRB]] Y5 = R1 * 0.299 + G1 * 0.587 + B1 * 0.114; B5 = (B1 - Y5) / 1.772; R5 = (R1 - Y5) / 1.402; local v0 = function (t0) return (t0 > (24 / 116) ^ 3 and t0 ^ (1 / 3) or t0 / (3 * (24 / 116) ^ 2) + 16 / 116) end  --[[CMYK2XYZ]] Z6 = h0(R1) * 0.0193 + h0(G1) * 0.1192 + h0(B1) * 0.9505; Y6 = h0(R1) * 0.2126 + h0(G1) * 0.7152 + h0(B1) * 0.0722; X6 = h0(R1) * 0.4124 + h0(G1) * 0.3576 + h0(B1) * 0.1805  --[[CMYK2xyL]] L7 = Y6; y7 = (X6 + Y6 + Z6 == 0 and 0 or Y6 / (X6 + Y6 + Z6)); x7 = (X6 + Y6 + Z6 == 0 and 0 or X6 / (X6 + Y6 + Z6))  --[[CMYK2Lab]] b8 = 200 * (v0(Y6 / 1.00000) - v0(Z6 / 1.08883)); a8 = 500 * (v0(X6 / 0.95047) - v0(Y6 / 1.00000)); L8 = 116 * v0(Y6 / 1.00000) - 16  elseif s == 5  then B5, R5, Y5 = arg[3], arg[2], arg[1]; local v0 = function (t0) return (t0 > (24 / 116) ^ 3 and t0 ^ (1 / 3) or t0 / (3 * (24 / 116) ^ 2) + 16 / 116) end  --[[YRB2RGB]]  B1 = Y5 + 1.772 * B5; G1 = Y5 - (0.299 * 1.402 / 0.587) * R5 - (0.114 * 1.772 / 0.587) * B5; R1 = Y5 + 1.402 * R5; local X0, x0 = math.max(R1, G1, B1), math.min(R1, G1, B1); local C0 = X0 - x0  --[[YRB2HSV]]  V2 = X0; S2 = (V2 == 0 and 0 or C0 / V2); H2 = (C0 == 0 and 0 or (V2 == R1 and (G1 - B1) / C0 % 6 or (V2 == G1 and (B1 - R1) / C0 + 2 or (V2 == B1 and (R1 - G1) / C0 + 4 or 0)))) / 6  --[[YRB2HSL]]  L3 = (X0 + x0) / 2; S3 = ((L3 == 0 or L3 == 1) and 0 or (V2 - L3) / math.min(L3, 1 - L3)); H3 = H2; local h0 = function (n0) return (n0 > 0.04045 and ((n0 + 0.055) / 1.055) ^ 2.4 or n0 / 12.92) end  --[[YRB2CMYK]] K4 = 1 - X0; Y4 = (K4 == 1 and 0 or (1 - B1 - K4) / (1 - K4)); M4 = (K4 == 1 and 0 or (1 - G1 - K4) / (1 - K4)); C4 = (K4 == 1 and 0 or (1 - R1 - K4) / (1 - K4))  --[[YRB2XYZ]]  Z6 = h0(R1) * 0.0193 + h0(G1) * 0.1192 + h0(B1) * 0.9505; Y6 = h0(R1) * 0.2126 + h0(G1) * 0.7152 + h0(B1) * 0.0722; X6 = h0(R1) * 0.4124 + h0(G1) * 0.3576 + h0(B1) * 0.1805  --[[YRB2xyL]]  L7 = Y6; y7 = (X6 + Y6 + Z6 == 0 and 0 or Y6 / (X6 + Y6 + Z6)); x7 = (X6 + Y6 + Z6 == 0 and 0 or X6 / (X6 + Y6 + Z6))  --[[YRB2Lab]]  b8 = 200 * (v0(Y6 / 1.00000) - v0(Z6 / 1.08883)); a8 = 500 * (v0(X6 / 0.95047) - v0(Y6 / 1.00000)); L8 = 116 * v0(Y6 / 1.00000) - 16  elseif s == 6  then Z6, Y6, X6 = arg[3], arg[2], arg[1]; local q0 = function (n0) return (n0 > 0.0031308 and 1.055 * n0 ^ (1 / 2.4) - 0.055 or n0 * 12.92) end  --[[XYZ2RGB]]  B1 = q0(X6*0.0557-Y6*0.2040+Z6*1.0570); G1 = q0(-X6*0.9689+Y6*1.8758+Z6*0.0415); R1 = q0(X6*3.2406-Y6*1.5372-Z6*0.4986); local X0, x0 = math.max(R1, G1, B1), math.min(R1, G1, B1); local C0 = X0 - x0  --[[XYZ2HSV]]  V2 = X0; S2 = (V2 == 0 and 0 or C0 / V2); H2 = (C0 == 0 and 0 or (V2 == R1 and (G1 - B1) / C0 % 6 or (V2 == G1 and (B1 - R1) / C0 + 2 or (V2 == B1 and (R1 - G1) / C0 + 4 or 0)))) / 6  --[[XYZ2HSL]]  L3 = (X0 + x0) / 2; S3 = ((L3 == 0 or L3 == 1) and 0 or (V2 - L3) / math.min(L3, 1 - L3)); H3 = H2  --[[XYZ2CMYK]] K4 = 1 - X0; Y4 = (K4 == 1 and 0 or (1 - B1 - K4) / (1 - K4)); M4 = (K4 == 1 and 0 or (1 - G1 - K4) / (1 - K4)); C4 = (K4 == 1 and 0 or (1 - R1 - K4) / (1 - K4))  --[[XYZ2YRB]]  Y5 = R1 * 0.299 + G1 * 0.587 + B1 * 0.114; B5 = (B1 - Y5) / 1.772; R5 = (R1 - Y5) / 1.402; local v0 = function (t0) return (t0 > (24 / 116) ^ 3 and t0 ^ (1 / 3) or t0 / (3 * (24 / 116) ^ 2) + 16 / 116) end  --[[XYZ2xyL]]  L7 = Y6; y7 = (X6 + Y6 + Z6 == 0 and 0 or Y6 / (X6 + Y6 + Z6)); x7 = (X6 + Y6 + Z6 == 0 and 0 or X6 / (X6 + Y6 + Z6))  --[[XYZ2Lab]]  b8 = 200 * (v0(Y6 / 1.00000) - v0(Z6 / 1.08883)); a8 = 500 * (v0(X6 / 0.95047) - v0(Y6 / 1.00000)); L8 = 116 * v0(Y6 / 1.00000) - 16  elseif s == 7  then L7, y7, x7 = arg[3], arg[2], arg[1]  --[[xyL2XYZ]]  Z6 = (y7 == 0 and 0 or (1 - x7 - y7) * L7 / y7); Y6 = L7; X6 = (y7 == 0 and 0 or x7 * L7 / y7); local q0 = function (n0) return (n0 > 0.0031308 and 1.055 * n0 ^ (1 / 2.4) - 0.055 or n0 * 12.92) end  --[[xyL2RGB]]  B1 = q0(X6*0.0557-Y6*0.2040+Z6*1.0570); G1 = q0(-X6*0.9689+Y6*1.8758+Z6*0.0415); R1 = q0(X6*3.2406-Y6*1.5372-Z6*0.4986); local X0, x0 = math.max(R1, G1, B1), math.min(R1, G1, B1); local C0 = X0 - x0  --[[xyL2HSV]]  V2 = X0; S2 = (V2 == 0 and 0 or C0 / V2); H2 = (C0 == 0 and 0 or (V2 == R1 and (G1 - B1) / C0 % 6 or (V2 == G1 and (B1 - R1) / C0 + 2 or (V2 == B1 and (R1 - G1) / C0 + 4 or 0)))) / 6  --[[xyL2HSL]]  L3 = (X0 + x0) / 2; S3 = ((L3 == 0 or L3 == 1) and 0 or (V2 - L3) / math.min(L3, 1 - L3)); H3 = H2  --[[xyL2CMYK]] K4 = 1 - X0; Y4 = (K4 == 1 and 0 or (1 - B1 - K4) / (1 - K4)); M4 = (K4 == 1 and 0 or (1 - G1 - K4) / (1 - K4)); C4 = (K4 == 1 and 0 or (1 - R1 - K4) / (1 - K4))  --[[xyL2YRB]]  Y5 = R1 * 0.299 + G1 * 0.587 + B1 * 0.114; B5 = (B1 - Y5) / 1.772; R5 = (R1 - Y5) / 1.402; local v0 = function (t0) return (t0 > (24 / 116) ^ 3 and t0 ^ (1 / 3) or t0 / (3 * (24 / 116) ^ 2) + 16 / 116) end  --[[xyL2Lab]]  b8 = 200 * (v0(Y6 / 1.00000) - v0(Z6 / 1.08883)); a8 = 500 * (v0(X6 / 0.95047) - v0(Y6 / 1.00000)); L8 = 116 * v0(Y6 / 1.00000) - 16  elseif s == 8  then b8, a8, L8 = arg[3] * 256, arg[2] * 256, arg[1] * 100; local w0 = function (t0) return (t0 > (24 / 116) and t0 ^ 3 or 3 * (24 / 116) ^ 2 * (t0 - 16 / 116)) end  --[[Lab2XYZ]]  Z6 = 1.08883*w0((L8+16)/116-b8/200); Y6 = 1.00000*w0((L8+16)/116); X6 = 0.95047*w0((L8+16)/116+a8/500); local q0 = function (n0) return (n0 > 0.0031308 and 1.055 * n0 ^ (1 / 2.4) - 0.055 or n0 * 12.92) end  --[[Lab2RGB]]  B1 = q0(X6*0.0557-Y6*0.2040+Z6*1.0570); G1 = q0(-X6*0.9689+Y6*1.8758+Z6*0.0415); R1 = q0(X6*3.2406-Y6*1.5372-Z6*0.4986); local X0, x0 = math.max(R1, G1, B1), math.min(R1, G1, B1); local C0 = X0 - x0  --[[Lab2HSV]]  V2 = X0; S2 = (V2 == 0 and 0 or C0 / V2); H2 = (C0 == 0 and 0 or (V2 == R1 and (G1 - B1) / C0 % 6 or (V2 == G1 and (B1 - R1) / C0 + 2 or (V2 == B1 and (R1 - G1) / C0 + 4 or 0)))) / 6  --[[Lab2HSL]]  L3 = (X0 + x0) / 2; S3 = ((L3 == 0 or L3 == 1) and 0 or (V2 - L3) / math.min(L3, 1 - L3)); H3 = H2  --[[Lab2CMYK]] K4 = 1 - X0; Y4 = (K4 == 1 and 0 or (1 - B1 - K4) / (1 - K4)); M4 = (K4 == 1 and 0 or (1 - G1 - K4) / (1 - K4)); C4 = (K4 == 1 and 0 or (1 - R1 - K4) / (1 - K4))  --[[Lab2YRB]]  Y5 = R1 * 0.299 + G1 * 0.587 + B1 * 0.114; B5 = (B1 - Y5) / 1.772; R5 = (R1 - Y5) / 1.402  --[[Lab2xyY]]  L7 = Y6; y7 = (X6 + Y6 + Z6 == 0 and 0 or Y6 / (X6 + Y6 + Z6)); x7 = (X6 + Y6 + Z6 == 0 and 0 or X6 / (X6 + Y6 + Z6))  end  R1,G1,B1,H2,S2,V2,H3,S3,L3,C4,M4,Y4,K4,Y5,R5,B5,X6,Y6,Z6,x7,y7,L7,L8,a8,b8,H9,V9,C9 =   Rnd(R1*255,G1*255,B1*255,H2*360,S2*100,V2*100,H3*360,S3*100,L3*100,C4*100,M4*100,Y4*100,K4*100,Y5*1,R5*1,B5*1,X6*100,Y6*100,Z6*100,x7*100,y7*100,L7*100,L8*1,a8*1,b8*1,H9*100,V9*10,C9*40, arg[decimalargidx[s]])  if arg[decimalargidx[s] + 1] then    local  returnstring = string.gsub(arg[decimalargidx[s] + 1], '(%u%d+)', function (s) return getfenv(1)[s] end)    R1,G1,B1,H2,S2,V2,H3,S3,L3,C4,M4,Y4,K4,Y5,R5,B5,X6,Y6,Z6,x7,y7,L7,L8,a8,b8,H9,V9,C9 = tR1,tG1,tB1,tH2,tS2,tV2,tH3,tS3,tL3,tC4,tM4,tY4,tK4,tY5,tR5,tB5,tX6,tY6,tZ6,tx7,ty7,tL7,tL8,ta8,tb8,tH9,tV9,tC9    return returnstring  else return true endend
I say this cause the conversion doesn't seem to be overly complicated, unless I'm missing something (it's been a while since I tackled color spaces). That being said, my code has some bugs too, mainly related to inherent value overflow between very different color spaces, which I didn't bother to clamp more than absolutely necessary.

But again, your skin is a joy to use and play with - I was just sharing my view from a technical perspective above. ;)

Statistics: Posted by Yincognito — Yesterday, 9:27 pm



Viewing all articles
Browse latest Browse all 1609

Trending Articles