Color Nodes: A-Value must be in 0-100 range, not 0-255

Hi,

per W3C docs, the alpha values representing the opacity in RGBA values should not exceed 100. Though, the Extract Color node, respectively all color nodes, expect a range of 0-255.

Here is the test workflow:

Best
Mike

Hi Mike, in general there are two ways to assign the alpha/transparency value.
First is to go from 0 to 100% (sometimes also 0.0–1.0), which is, e.g., what W3C does for rgba().
Second is to go from 0 to 255 (or 00 to FF in hexadecimal), which directly assigns the available 8 bits. This is for example also used by W3C for #000000ff.
In a sense, the latter is precise, since you can directly specify all possible 255 values and don’t need to consider the conversion from 0–100 to 0–255.
At least to me, it also feels more consistent to specify all four dimensions on similar scales, but that may be subjective.

Best regards,
nan

1 Like

Hi @nan,

thanks for the explanation. Though, the color manager node only accepts int as a variable input for color values. If the RGBA value is generated in a way, 0-255 for all values vs. 0-255 for RGB and 0-1.0 for alpha, it causes lots of confusion.

If color management ever is improved, and literally everyone is familiar with the default rgba notation, this certainly is causing issues. Factoring in the overall shift of Knime towards a web interface driven experience, consistency becomes even more important I believe.

Best
Mike