Author Topic: How to easily get HSL accurate to RGB ?  (Read 3465 times)

typeyourlogin@gmail.com


For HSL, the Hue value is usually given in degrees, but the Specific Parameters for an HSL node in Substance Designer takes a 0 to 1 value for Hue. 

I tried using some degrees conversion maths but couldn't figure it out.  I'm using gold, 255, 226, 155 RGB. 
The values I'm getting for gold's hue are wrong (and for copper I get green) using : http://colorizer.org/
There, the HSL for gold would be 42.6', 100%, 80.4% or so.

If I approximate the values myself in a HSL node to what the RGB (converted to HSL by a function) produce they differ from accurate values, as shown in the image (HSL 0.01, 1, 0,9):


I saw there's a function called RGBtoHSL along with many others.  Could anyone point me to documentation links or examples for using the provided function nodes?
 


For HSL, the Hue value is usually given in degrees, but the Specific Parameters for an HSL node in Substance Designer takes a 0 to 1 value for Hue. 

I tried using some degrees conversion maths but couldn't figure it out.  I'm using gold, 255, 226, 155 RGB. 
The values I'm getting for gold's hue are wrong (and for copper I get green) using : http://colorizer.org/
There, the HSL for gold would be 42.6', 100%, 80.4% or so.

If I approximate the values myself in a HSL node to what the RGB (converted to HSL by a function) produce they differ from accurate values, as shown in the image (HSL 0.01, 1, 0,9):


I saw there's a function called RGBtoHSL along with many others.  Could anyone point me to documentation links or examples for using the provided function nodes?

Hi,

The range is [0,1] in SD. The RGB to HSL outputs values in [0,1] and the HSL to RGB inputs values in [0,1].

The RGBtoHSL node is a function. You need to use it in a function. In the attached image, I show a function that is created on a uniform color. The input parameter at the root of the graph is a float 3 for RGB. I then convert the float 3 to HSL and output a float4 for the RGBA needed for the uniform color.

Cheers,

Wes

Integrations Product Manager / Training
wes.mcdermott@allegorithmic.com
Twitter: The3DNinja