.. Generated automatically by doc/tools/makerst.py in Godot's source tree. .. DO NOT EDIT THIS FILE, but the ColorRect.xml source instead. .. The source is found in doc/classes or modules//doc_classes. .. _class_ColorRect: ColorRect ========= **Inherits:** :ref:`Control` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` **Category:** Core Brief Description ----------------- Colored rect for canvas. Member Functions ---------------- +----------------------------+-------------------------------------------------------------------------------------------------------+ | :ref:`Color` | :ref:`get_frame_color` **(** **)** const | +----------------------------+-------------------------------------------------------------------------------------------------------+ | void | :ref:`set_frame_color` **(** :ref:`Color` color **)** | +----------------------------+-------------------------------------------------------------------------------------------------------+ Member Variables ---------------- - :ref:`Color` **color** - The color to fill the [code]ColorRect[/code]. [codeblock] $ColorRect.color = Color(1, 0, 0, 1) # Set ColorRect node's color to red [/codeblock] Description ----------- An object that is represented on the canvas as a rect with color. :ref:`Color` is used to set or get color info for the rect. Member Function Description --------------------------- .. _class_ColorRect_get_frame_color: - :ref:`Color` **get_frame_color** **(** **)** const Return the color in RGBA format. :: var cr = get_node("colorrect_node") var c = cr.get_frame_color() # Default color is white .. _class_ColorRect_set_frame_color: - void **set_frame_color** **(** :ref:`Color` color **)** Set new color to ColorRect. :: var cr = get_node("colorrect_node") cr.set_frame_color(Color(1, 0, 0, 1)) # Set color rect node to red