197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
|
new.green = clip(new.green - (new.green * fac))
end);
}
if g == nil then
if type(r) == 'string' then
assert(false) -- TODO parse color string
elseif type(r) == 'table' then
new.red = r[1]
new.green = r[2]
new.blue = r[3]
new.alpha = r[4]
else assert(false) end
else
new.red = r
new.green = g
new.blue = b
new.alpha = a
end
return new
end
}
return color
|
|
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
|
new.green = clip(new.green - (new.green * fac))
end);
}
if g == nil then
if type(r) == 'string' then
assert(false) -- TODO parse color string
elseif type(r) == 'table' then
if r.hue then
return from_hsl(r, r.alpha or g)
else
new.red = r[1]
new.green = r[2]
new.blue = r[3]
new.alpha = r[4]
end
else assert(false) end
else
new.red = r
new.green = g
new.blue = b
new.alpha = a
end
return new
end
}
return color
|