.. Generated automatically by doc/tools/makerst.py in Godot's source tree. .. DO NOT EDIT THIS FILE, but the doc/base/classes.xml source instead. .. _class_Color: Color ===== **Category:** Built-In Types Brief Description ----------------- Color in RGBA format. Member Functions ---------------- +------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Color` | :ref:`Color` **(** :ref:`float` r, :ref:`float` g, :ref:`float` b, :ref:`float` a **)** | +------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Color` | :ref:`Color` **(** :ref:`float` r, :ref:`float` g, :ref:`float` b **)** | +------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Color` | :ref:`Color` **(** :ref:`int` from **)** | +------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Color` | :ref:`Color` **(** :ref:`String` from **)** | +------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Color` | :ref:`blend` **(** :ref:`Color` over **)** | +------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Color` | :ref:`contrasted` **(** **)** | +------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`gray` **(** **)** | +------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Color` | :ref:`inverted` **(** **)** | +------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Color` | :ref:`linear_interpolate` **(** :ref:`Color` b, :ref:`float` t **)** | +------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`to_32` **(** **)** | +------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`to_ARGB32` **(** **)** | +------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`to_html` **(** :ref:`bool` with_alpha=True **)** | +------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ Member Variables ---------------- - :ref:`float` **a** - Alpha (0 to 1) - :ref:`int` **a8** - Alpha (0 to 255) - :ref:`float` **b** - Blue (0 to 1) - :ref:`int` **b8** - Blue (0 to 255) - :ref:`float` **g** - Green (0 to 1) - :ref:`int` **g8** - Green (0 to 255) - :ref:`float` **h** - Hue (0 to 1) - :ref:`float` **r** - Red (0 to 1) - :ref:`int` **r8** - Red (0 to 255) - :ref:`float` **s** - Saturation (0 to 1) - :ref:`float` **v** - Value (0 to 1) Description ----------- A color is represented as red, green and blue (r,g,b) components. Additionally, "a" represents the alpha component, often used for transparency. Values are in floating point and usually range from 0 to 1. Some methods (such as set_modulate() ) may accept values > 1. Member Function Description --------------------------- .. _class_Color_Color: - :ref:`Color` **Color** **(** :ref:`float` r, :ref:`float` g, :ref:`float` b, :ref:`float` a **)** Construct the color from an RGBA profile. .. _class_Color_Color: - :ref:`Color` **Color** **(** :ref:`float` r, :ref:`float` g, :ref:`float` b **)** Construct the color from an RGBA profile. .. _class_Color_Color: - :ref:`Color` **Color** **(** :ref:`int` from **)** Construct the color from an RGBA profile. .. _class_Color_Color: - :ref:`Color` **Color** **(** :ref:`String` from **)** Construct the color from an RGBA profile. .. _class_Color_blend: - :ref:`Color` **blend** **(** :ref:`Color` over **)** Return a new color blended with anothor one. .. _class_Color_contrasted: - :ref:`Color` **contrasted** **(** **)** Return the most contrasting color with this one. .. _class_Color_gray: - :ref:`float` **gray** **(** **)** Convert the color to gray. .. _class_Color_inverted: - :ref:`Color` **inverted** **(** **)** Return the inverted color (1-r, 1-g, 1-b, 1-a). .. _class_Color_linear_interpolate: - :ref:`Color` **linear_interpolate** **(** :ref:`Color` b, :ref:`float` t **)** Return the linear interpolation with another color. .. _class_Color_to_32: - :ref:`int` **to_32** **(** **)** Convert the color to a 32 its integer (each byte represents a RGBA). .. _class_Color_to_ARGB32: - :ref:`int` **to_ARGB32** **(** **)** Convert color to ARGB32, more compatible with DirectX. .. _class_Color_to_html: - :ref:`String` **to_html** **(** :ref:`bool` with_alpha=True **)** Return the HTML hexadecimal color string.