Team Spartan Cookies & Milk Forums
Full HSV/HSL/Hex Colour support? - Printable Version

+- Team Spartan Cookies & Milk Forums (https://teamscm.co.uk)
+-- Forum: Garry's Mod (https://teamscm.co.uk/forum-4.html)
+--- Forum: Starfall (https://teamscm.co.uk/forum-7.html)
+--- Thread: Full HSV/HSL/Hex Colour support? (/thread-3369.html)



Full HSV/HSL/Hex Colour support? - frdhog - 08-07-2020

I noticed that Starfall only has Color.fromHSV and Color.fromHex but no methods to oppose these.
Could we have the GLua functions of HSLToColor, ColorToHSL, ColorToHSV and possibly a ColorToHex function?
These would be greatly appreciated,
frdhog


RE: Full HSV/HSL/Hex Colour support? - Person8880 - 08-07-2020

Colours already have methods to convert between colour spaces, they just weren't in the SF docs. Use Color:ToHSV() and Color:ToHSL() to convert from RGB (these are now documented).

I'll add hex conversion and HSL to RGB at some point, don't have time to do it today.