class_colorramp.rst 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  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. | :ref:`Color<class_color>` | :ref:`get_color<class_ColorRamp_get_color>` **(** :ref:`int<class_int>` point **)** const |
  17. +----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+
  18. | :ref:`PoolColorArray<class_poolcolorarray>` | :ref:`get_colors<class_ColorRamp_get_colors>` **(** **)** const |
  19. +----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+
  20. | :ref:`float<class_float>` | :ref:`get_offset<class_ColorRamp_get_offset>` **(** :ref:`int<class_int>` point **)** const |
  21. +----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+
  22. | :ref:`PoolRealArray<class_poolrealarray>` | :ref:`get_offsets<class_ColorRamp_get_offsets>` **(** **)** const |
  23. +----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+
  24. | :ref:`int<class_int>` | :ref:`get_point_count<class_ColorRamp_get_point_count>` **(** **)** const |
  25. +----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+
  26. | :ref:`Color<class_color>` | :ref:`interpolate<class_ColorRamp_interpolate>` **(** :ref:`float<class_float>` offset **)** |
  27. +----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+
  28. | void | :ref:`remove_point<class_ColorRamp_remove_point>` **(** :ref:`int<class_int>` offset **)** |
  29. +----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+
  30. | void | :ref:`set_color<class_ColorRamp_set_color>` **(** :ref:`int<class_int>` point, :ref:`Color<class_color>` color **)** |
  31. +----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+
  32. | void | :ref:`set_colors<class_ColorRamp_set_colors>` **(** :ref:`PoolColorArray<class_poolcolorarray>` colors **)** |
  33. +----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+
  34. | void | :ref:`set_offset<class_ColorRamp_set_offset>` **(** :ref:`int<class_int>` point, :ref:`float<class_float>` offset **)** |
  35. +----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+
  36. | void | :ref:`set_offsets<class_ColorRamp_set_offsets>` **(** :ref:`PoolRealArray<class_poolrealarray>` offsets **)** |
  37. +----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+
  38. Member Variables
  39. ----------------
  40. - :ref:`float<class_float>` **colors**
  41. - :ref:`float<class_float>` **offsets**
  42. Description
  43. -----------
  44. 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.
  45. Member Function Description
  46. ---------------------------
  47. .. _class_ColorRamp_add_point:
  48. - void **add_point** **(** :ref:`float<class_float>` offset, :ref:`Color<class_color>` color **)**
  49. Adds the specified color to the end of the ramp, with the specified offset
  50. .. _class_ColorRamp_get_color:
  51. - :ref:`Color<class_color>` **get_color** **(** :ref:`int<class_int>` point **)** const
  52. Returns the color of the ramp color at index *point*
  53. .. _class_ColorRamp_get_colors:
  54. - :ref:`PoolColorArray<class_poolcolorarray>` **get_colors** **(** **)** const
  55. Returns the colors in the ramp
  56. .. _class_ColorRamp_get_offset:
  57. - :ref:`float<class_float>` **get_offset** **(** :ref:`int<class_int>` point **)** const
  58. Returns the offset of the ramp color at index *point*
  59. .. _class_ColorRamp_get_offsets:
  60. - :ref:`PoolRealArray<class_poolrealarray>` **get_offsets** **(** **)** const
  61. Returns the offsets for the colors in this ramp
  62. .. _class_ColorRamp_get_point_count:
  63. - :ref:`int<class_int>` **get_point_count** **(** **)** const
  64. Returns the number of colors in the ramp
  65. .. _class_ColorRamp_interpolate:
  66. - :ref:`Color<class_color>` **interpolate** **(** :ref:`float<class_float>` offset **)**
  67. Returns the interpolated color specified by *offset*
  68. .. _class_ColorRamp_remove_point:
  69. - void **remove_point** **(** :ref:`int<class_int>` offset **)**
  70. Removes the color at the index *offset*
  71. .. _class_ColorRamp_set_color:
  72. - void **set_color** **(** :ref:`int<class_int>` point, :ref:`Color<class_color>` color **)**
  73. Sets the color of the ramp color at index *point*
  74. .. _class_ColorRamp_set_colors:
  75. - void **set_colors** **(** :ref:`PoolColorArray<class_poolcolorarray>` colors **)**
  76. 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.
  77. .. _class_ColorRamp_set_offset:
  78. - void **set_offset** **(** :ref:`int<class_int>` point, :ref:`float<class_float>` offset **)**
  79. Sets the offset for the ramp color at index *point*
  80. .. _class_ColorRamp_set_offsets:
  81. - void **set_offsets** **(** :ref:`PoolRealArray<class_poolrealarray>` offsets **)**
  82. 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.