Qt Reference Documentation

QML Basic Type: color

A color is a standard color name in quotes. It is normally specified as an SVG color name. These names include colors like "red", "green" and "lightsteelblue".

If the color you want isn't part of this list, colors can also be specified in hexidecimal triplets or quads that take 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".

Example:

 Rectangle { color: "steelblue" }
 Rectangle { color: "#FF0000" }
 Rectangle { color: "#800000FF" }

Or with the Qt.rgba(), Qt.hsla(), Qt.darker(), Qt.lighter() or Qt.tint() functions:

 Rectangle { color: Qt.rgba(255, 0, 0, 1) }

See also QML Basic Types.

X

Thank you for giving your feedback.

Make sure it is related to this specific page. For more general bugs and requests, please use the Qt Bug Tracker.

[0]; s.parentNode.insertBefore(ga, s); })();