.. 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_Gradient: Gradient ======== **Inherits:** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` **Category:** Core Brief Description ----------------- Color interpolator node Member Functions ---------------- +----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`add_point` **(** :ref:`float` offset, :ref:`Color` color **)** | +----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------+ | :ref:`Color` | :ref:`get_color` **(** :ref:`int` point **)** const | +----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------+ | :ref:`PoolColorArray` | :ref:`get_colors` **(** **)** const | +----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`get_offset` **(** :ref:`int` point **)** const | +----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------+ | :ref:`PoolRealArray` | :ref:`get_offsets` **(** **)** const | +----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_point_count` **(** **)** const | +----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------+ | :ref:`Color` | :ref:`interpolate` **(** :ref:`float` offset **)** | +----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`remove_point` **(** :ref:`int` offset **)** | +----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_color` **(** :ref:`int` point, :ref:`Color` color **)** | +----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_colors` **(** :ref:`PoolColorArray` colors **)** | +----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_offset` **(** :ref:`int` point, :ref:`float` offset **)** | +----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_offsets` **(** :ref:`PoolRealArray` offsets **)** | +----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------+ Member Variables ---------------- - :ref:`PoolColorArray` **colors** - :ref:`PoolRealArray` **offsets** Description ----------- Given a set of colors, this node will interpolate them in order, meaning, that if you have color 1, color 2 and color3, the ramp will interpolate (generate the colors between two colors) from color 1 to color 2 and from color 2 to color 3. Initially the ramp will have 2 colors (black and white), one (black) at ramp lower offset offset 0 and the other (white) at the ramp higher offset 1. Member Function Description --------------------------- .. _class_Gradient_add_point: - void **add_point** **(** :ref:`float` offset, :ref:`Color` color **)** Adds the specified color to the end of the ramp, with the specified offset .. _class_Gradient_get_color: - :ref:`Color` **get_color** **(** :ref:`int` point **)** const Returns the color of the ramp color at index *point* .. _class_Gradient_get_colors: - :ref:`PoolColorArray` **get_colors** **(** **)** const Returns the colors in the ramp .. _class_Gradient_get_offset: - :ref:`float` **get_offset** **(** :ref:`int` point **)** const Returns the offset of the ramp color at index *point* .. _class_Gradient_get_offsets: - :ref:`PoolRealArray` **get_offsets** **(** **)** const Returns the offsets for the colors in this ramp .. _class_Gradient_get_point_count: - :ref:`int` **get_point_count** **(** **)** const Returns the number of colors in the ramp .. _class_Gradient_interpolate: - :ref:`Color` **interpolate** **(** :ref:`float` offset **)** Returns the interpolated color specified by *offset* .. _class_Gradient_remove_point: - void **remove_point** **(** :ref:`int` offset **)** Removes the color at the index *offset* .. _class_Gradient_set_color: - void **set_color** **(** :ref:`int` point, :ref:`Color` color **)** Sets the color of the ramp color at index *point* .. _class_Gradient_set_colors: - void **set_colors** **(** :ref:`PoolColorArray` colors **)** Sets the colors for the specified amount of elements. Calling this function with a different number of elements than previously defined causes the ramp to resize its colors and offsets array to accommodate the new elements. .. _class_Gradient_set_offset: - void **set_offset** **(** :ref:`int` point, :ref:`float` offset **)** Sets the offset for the ramp color at index *point* .. _class_Gradient_set_offsets: - void **set_offsets** **(** :ref:`PoolRealArray` offsets **)** Sets the offset for the specified amount of elements. Calling this function with a different number of elements than previously defined causes the ramp to resize its colors and offsets array to accommodate the new elements, all new colors will be black by default.