HSVtoRGB
Definition
-- @/lua/common/utils.lua:43
function HSVtoRGB(h, s, v)
s = v * s
local h6, is = h * 6, v - s
return is + s*min(max(abs(h6-3)-1, 0), 1), is + s*min(max(2-abs(h6-2), 0), 1), is + s*min(max(2-abs(h6-4), 0), 1)
end
Callers
@/lua/ge/extensions/freeroam/bigMapMode.lua
local h, s, v = RGBtoHSV(unpack(core_groundMarkers.color)) -- groundMarkerColor
local r, g, b = HSVtoRGB(h, s, 1)
local color = ColorF(r, g, b, navRouteAlpha)
local h, s, v = RGBtoHSV(unpack(core_groundMarkers.color or {0.1, 0.25, 0.5})) -- groundMarkerColor
local r, g, b = HSVtoRGB(h, 0.3, 1) -- routePreviewCol
local color = ColorF(r, g, b, navRouteAlpha * 0.7)
@/lua/ge/extensions/editor/vehicleEditor/staticEditor/veJBeamModifierLeakVis.lua
tempColVec.x = math.fmod(idx / 20, 1)
local r, g, b = HSVtoRGB(tempColVec:xyz())
im.TableSetBgColor(im.TableBgTarget_CellBg, im.GetColorU322(im.ImVec4(r, g, b, 0.5)), sectionModIdx)
tempColVec.x = math.fmod(partIdx / 20, 1)
local r, g, b = HSVtoRGB(tempColVec:xyz())
local imCol = im.GetColorU322(im.ImVec4(r, g, b, 0.5))
@/lua/vehicle/partCondition.lua
s = s * saturationCoef
agedColor[1], agedColor[2], agedColor[3] = HSVtoRGB(h, s, v)
-- c) increase lightness, per color
@/lua/ge/extensions/editor/trafficSignalsEditor.lua
if controller.id == sc.id then
r, g, b = HSVtoRGB(i / (#ctrlArray + 1), 1, 1)
break
@/lua/ge/extensions/editor/rallyEditor/measurementsTab.lua
local r, g, b = HSVtoRGB(h, s, v)
@/lua/ge/extensions/flowgraph/nodes/util/randomColor.lua
if self.pinIn.cuteColor.value then
local r, g, b = HSVtoRGB(math.random(), lerp(1, 0.7, square(math.random())), lerp(1, 0.7, square(math.random())))
self.pinOut.color.value = {r, g, b, a}
@/lua/ge/extensions/flowgraph/basenode.lua
function C:HSVtoRGB(h,s,v)
h = h - math.floor(h)
h = h - math.floor(h)
return {HSVtoRGB(math.max(0, math.min(1, h)), math.max(0, math.min(1, s)), math.max(0, math.min(1, v)))}
end
else
local c = self:HSVtoRGB(math.max(0.3-oldness*0.15,-0.3), math.min(1, 2/(( self.mgr.frameCount- self._frameLastUsed )/100+1)), 1)
self._lastHeatmapColor = im.ImVec4(c[1],c[2],c[3],0.9)
@/lua/ge/extensions/flowgraph/nodes/util/hsvColor.lua
function C:HSVtoRGB(h,s,v)
h = h - math.floor(h)
h = h - math.floor(h)
return {HSVtoRGB(math.max(0, math.min(1, h)), math.max(0, math.min(1, s)), math.max(0, math.min(1, v)))}
end
function C:work()
local rgb = self:HSVtoRGB(self.pinIn.h.value or 0, self.pinIn.s.value or 1, self.pinIn.v.value or 1)
self.pinOut.color.value = {rgb[1],rgb[2],rgb[3], self.pinIn.a.value or 1}