-
-
Notifications
You must be signed in to change notification settings - Fork 54
Closed
Labels
Description
Dyon supports HTML hex colors, e.g. #aaffcc, directly in the syntax. This is converted automatically into vec4 with color components (r/255, g/255, b/255, a/255).
Without alpha:
#aaffcc // alpha is 1With alpha:
#aaffcc00 // alpha is 0This is designed for:
- Easier copying colors from image editors
- Recognize color settings in meta data syntax, for example a tool to tweak colors while running
Notice
The normal color space for image editors is sRGB. When doing interpolation with colors, use srgb_to_linear_color and convert back to sRGB with linear_to_srgb_color.
Example:
a := srgb_to_linear(color: #ff0000)
b := srgb_to_linear(color: #00ff00)
t := 0.5
c := linear_to_srgb(color: t * a + (1-t) * b)