A template tag function for converting hexadecimal color codes to Vector4 colors. Here are some examples of how it can be used:
// Regular 6-digit format:hex`FF0000` // Red, is converted to [1, 0, 0, 1]// Short 3-digit format:hex`F00` // Red, equivalent to FF0000// 8- and 4-digit formats for controlling the alpha value:hex`00FF007F` // Half-transparent greenhex`FF0F` // Opaque yellow, equivalent to FFFF00// The color codes are case-insensitive:hex`58f` // Sky blue, equivalent to 5588FFhex`fF0eaB` // Magenta, equivalent to FF0EAB// Usage in properties:new LinearProperty(true, [ new Keyframe(0, hex`f00`), new Keyframe(1, hex`0f0`), new Keyframe(2, hex`00f`), new Keyframe(3, hex`f00`),]) Copy
// Regular 6-digit format:hex`FF0000` // Red, is converted to [1, 0, 0, 1]// Short 3-digit format:hex`F00` // Red, equivalent to FF0000// 8- and 4-digit formats for controlling the alpha value:hex`00FF007F` // Half-transparent greenhex`FF0F` // Opaque yellow, equivalent to FFFF00// The color codes are case-insensitive:hex`58f` // Sky blue, equivalent to 5588FFhex`fF0eaB` // Magenta, equivalent to FF0EAB// Usage in properties:new LinearProperty(true, [ new Keyframe(0, hex`f00`), new Keyframe(1, hex`0f0`), new Keyframe(2, hex`00f`), new Keyframe(3, hex`f00`),])
A template tag function for converting hexadecimal color codes to Vector4 colors. Here are some examples of how it can be used: