Project Spark Wiki

Default color variable

233pages on
this wiki
Add New Page
Comments0 Share

The default value of a color variable is (1, 1, 0.5) in HSL (hue, saturation, luminance) and 1 for the alpha.

However, there is no way to get a color literal with this value directly, as it corresponds to (255, 0, 0) in RGB, but creating a new color with those RGB values will create the color (0, 1, 0.5) in HSL, the hue is 0 instead of 1.

Thus, the easiest way to know whether a color variable has already been assigned is to test if it is equal to a color variable which we know has not been set previously, for instance [global] [color variable: DEFAULT COLOR] could be used for clarity's sake.

The color variable is the only variable type which does not default to an "empty" value ([no color] in this case). Note that [no color] is (0, 0, 0) in HSL and RGB, but its alpha value is -1 and not 0.

Source: Wrong default value for the color variable.

Ad blocker interference detected!

Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.