A color value can be converted to a string and a string can be assigned to
color properties. The string is a hexadecimal triplet or quad in the form
"#RRGGBB" and "#AARRGGBB" respectively. For example, the color red
corresponds to a triplet of "#FF0000" and a slightly transparent blue to a
quad of "#800000FF".
When a color property is not set, it will have an invalid color value but
its string representation will be "#000000" (same as black). The only known
way to determine whether a specific color value is invalid is to compare it
with a known invalid color value. This can be created using for example
tiled.color("invalid"):
if (color == "#000000")tiled.log("The color is black or invalid.");if (color === tiled.color("invalid"))tiled.log("The color is invalid!");if (color === tiled.color("#000000"))tiled.log("The color is black!");
A color value. Can be created using tiled.color.
A color value can be converted to a string and a string can be assigned to color properties. The string is a hexadecimal triplet or quad in the form "#RRGGBB" and "#AARRGGBB" respectively. For example, the color red corresponds to a triplet of "#FF0000" and a slightly transparent blue to a quad of "#800000FF".
When a color property is not set, it will have an invalid color value but its string representation will be "#000000" (same as black). The only known way to determine whether a specific color value is invalid is to compare it with a known invalid color value. This can be created using for example
tiled.color("invalid")
: