class_colorramp.rst 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  2. .. DO NOT EDIT THIS FILE, but the doc/base/classes.xml source instead.
  3. .. _class_ColorRamp:
  4. ColorRamp
  5. =========
  6. **Inherits:** :ref:`Resource<class_resource>` **<** :ref:`Reference<class_reference>` **<** :ref:`Object<class_object>`
  7. **Category:** Core
  8. Brief Description
  9. -----------------
  10. Color interpolator node
  11. Member Functions
  12. ----------------
  13. +--------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+
  14. | void | :ref:`add_point<class_ColorRamp_add_point>` **(** :ref:`float<class_float>` offset, :ref:`Color<class_color>` color **)** |
  15. +--------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+
  16. | void | :ref:`remove_point<class_ColorRamp_remove_point>` **(** :ref:`int<class_int>` offset **)** |
  17. +--------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+
  18. | void | :ref:`set_offset<class_ColorRamp_set_offset>` **(** :ref:`int<class_int>` point, :ref:`float<class_float>` offset **)** |
  19. +--------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+
  20. | :ref:`float<class_float>` | :ref:`get_offset<class_ColorRamp_get_offset>` **(** :ref:`int<class_int>` point **)** const |
  21. +--------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+
  22. | void | :ref:`set_color<class_ColorRamp_set_color>` **(** :ref:`int<class_int>` point, :ref:`Color<class_color>` color **)** |
  23. +--------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+
  24. | :ref:`Color<class_color>` | :ref:`get_color<class_ColorRamp_get_color>` **(** :ref:`int<class_int>` point **)** const |
  25. +--------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+
  26. | :ref:`Color<class_color>` | :ref:`interpolate<class_ColorRamp_interpolate>` **(** :ref:`float<class_float>` offset **)** |
  27. +--------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+
  28. | :ref:`int<class_int>` | :ref:`get_point_count<class_ColorRamp_get_point_count>` **(** **)** const |
  29. +--------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+
  30. | void | :ref:`set_offsets<class_ColorRamp_set_offsets>` **(** :ref:`RealArray<class_realarray>` offsets **)** |
  31. +--------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+
  32. | :ref:`RealArray<class_realarray>` | :ref:`get_offsets<class_ColorRamp_get_offsets>` **(** **)** const |
  33. +--------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+
  34. | void | :ref:`set_colors<class_ColorRamp_set_colors>` **(** :ref:`ColorArray<class_colorarray>` colors **)** |
  35. +--------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+
  36. | :ref:`ColorArray<class_colorarray>` | :ref:`get_colors<class_ColorRamp_get_colors>` **(** **)** const |
  37. +--------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+
  38. Description
  39. -----------
  40. 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.
  41. Member Function Description
  42. ---------------------------
  43. .. _class_ColorRamp_add_point:
  44. - void **add_point** **(** :ref:`float<class_float>` offset, :ref:`Color<class_color>` color **)**
  45. Adds the specified color to the end of the ramp, with the specified offset
  46. .. _class_ColorRamp_remove_point:
  47. - void **remove_point** **(** :ref:`int<class_int>` offset **)**
  48. Removes the color at the index *offset*
  49. .. _class_ColorRamp_set_offset:
  50. - void **set_offset** **(** :ref:`int<class_int>` point, :ref:`float<class_float>` offset **)**
  51. Sets the offset for the ramp color at index *point*
  52. .. _class_ColorRamp_get_offset:
  53. - :ref:`float<class_float>` **get_offset** **(** :ref:`int<class_int>` point **)** const
  54. Returns the offset of the ramp color at index *point*
  55. .. _class_ColorRamp_set_color:
  56. - void **set_color** **(** :ref:`int<class_int>` point, :ref:`Color<class_color>` color **)**
  57. Sets the color of the ramp color at index *point*
  58. .. _class_ColorRamp_get_color:
  59. - :ref:`Color<class_color>` **get_color** **(** :ref:`int<class_int>` point **)** const
  60. Returns the color of the ramp color at index *point*
  61. .. _class_ColorRamp_interpolate:
  62. - :ref:`Color<class_color>` **interpolate** **(** :ref:`float<class_float>` offset **)**
  63. Returns the interpolated color specified by *offset*
  64. .. _class_ColorRamp_get_point_count:
  65. - :ref:`int<class_int>` **get_point_count** **(** **)** const
  66. Returns the number of colors in the ramp
  67. .. _class_ColorRamp_set_offsets:
  68. - void **set_offsets** **(** :ref:`RealArray<class_realarray>` offsets **)**
  69. 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 accomodate the new elements, all new colors will be black by default.
  70. .. _class_ColorRamp_get_offsets:
  71. - :ref:`RealArray<class_realarray>` **get_offsets** **(** **)** const
  72. Returns the offsets for the colors in this ramp
  73. .. _class_ColorRamp_set_colors:
  74. - void **set_colors** **(** :ref:`ColorArray<class_colorarray>` colors **)**
  75. 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 accomodate the new elements.
  76. .. _class_ColorRamp_get_colors:
  77. - :ref:`ColorArray<class_colorarray>` **get_colors** **(** **)** const
  78. Returns the colors in the ramp