Content deleted Content added
No edit summary |
No edit summary |
||
Line 59:
-- this function returns the string "#RRGGBB" with approximate RGB value for a complementary color (reflection) to a color, defined as a wavelength passed as a first argument
-- The following formula is used for the complimentary color: {0xFF - RR, 0xFF - (RR + BB)/2, 0xFF - BB}
-- local wavelength = tonumber(frame.args[1])
-- nm2RGB(wavelength)
local result='#' .. string.format("%.2X%.2X%.2X", 255*(1-redvalue), 255*(1-greenvalue), 255*(1-bluevalue))▼
-- local result='#' .. string.format("%.2X%.2X%.2X", 255*(1-redvalue), 255*(1-greenvalue), 255*(1-bluevalue))
local wavelength = ceil(tonumber(frame.args[1])/10)*10
nm2RGB(wavelength)
▲ local result='#' .. string.format("%.2X%.2X%.2X", 255*
return result
end
|