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. | :ref:`Color<class_color>` | :ref:`get_color<class_ColorRamp_get_color>` **(** :ref:`int<class_int>` point **)** const |
  17. +--------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+
  18. | :ref:`ColorArray<class_colorarray>` | :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:`RealArray<class_realarray>` | :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:`ColorArray<class_colorarray>` 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:`RealArray<class_realarray>` offsets **)** |
  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_get_color:
  47. - :ref:`Color<class_color>` **get_color** **(** :ref:`int<class_int>` point **)** const
  48. Returns the color of the ramp color at index *point*
  49. .. _class_ColorRamp_get_colors:
  50. - :ref:`ColorArray<class_colorarray>` **get_colors** **(** **)** const
  51. Returns the colors in the ramp
  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_get_offsets:
  56. - :ref:`RealArray<class_realarray>` **get_offsets** **(** **)** const
  57. Returns the offsets for the colors in this ramp
  58. .. _class_ColorRamp_get_point_count:
  59. - :ref:`int<class_int>` **get_point_count** **(** **)** const
  60. Returns the number of colors in the ramp
  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_remove_point:
  65. - void **remove_point** **(** :ref:`int<class_int>` offset **)**
  66. Removes the color at the index *offset*
  67. .. _class_ColorRamp_set_color:
  68. - void **set_color** **(** :ref:`int<class_int>` point, :ref:`Color<class_color>` color **)**
  69. Sets the color of the ramp color at index *point*
  70. .. _class_ColorRamp_set_colors:
  71. - void **set_colors** **(** :ref:`ColorArray<class_colorarray>` colors **)**
  72. 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.
  73. .. _class_ColorRamp_set_offset:
  74. - void **set_offset** **(** :ref:`int<class_int>` point, :ref:`float<class_float>` offset **)**
  75. Sets the offset for the ramp color at index *point*
  76. .. _class_ColorRamp_set_offsets:
  77. - void **set_offsets** **(** :ref:`RealArray<class_realarray>` offsets **)**
  78. 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.