Work in progress
Godot documentation is being updated to reflect the latest changes in version
4.0. Some documentation pages may
still state outdated information. This banner will tell you if you're reading one of such pages.
The contents of this page are up to date. If you can still find outdated information, please open an issue.
Inherits: Control < CanvasItem < Node < Object
Displays a rectangle filled with a solid color. If you need to display the border alone, consider using ReferenceRect instead.
Color color =
Color(1, 1, 1, 1)
The fill color.
$ColorRect.color = Color(1, 0, 0, 1) # Set ColorRect's color to red.
GetNode<ColorRect>("ColorRect").Color = new Color(1, 0, 0, 1); // Set ColorRect's color to red.