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.

ColorRect

Inherits: Control < CanvasItem < Node < Object

Colored rectangle.

Description

Displays a rectangle filled with a solid color. If you need to display the border alone, consider using ReferenceRect instead.

Tutorials

Properties

Color

color

Color(1, 1, 1, 1)


Property Descriptions

Color color = Color(1, 1, 1, 1)

  • void set_color ( Color value )

  • Color get_color ( )

The fill color.

$ColorRect.color = Color(1, 0, 0, 1) # Set ColorRect's color to red.