Gradient.xml 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="Gradient" inherits="Resource" version="3.2">
  3. <brief_description>
  4. A color interpolator resource which can be used to generate colors between user-defined color points.
  5. </brief_description>
  6. <description>
  7. Given a set of colors, this resource will interpolate them in order. This means that if you have color 1, color 2 and color 3, the ramp will interpolate from color 1 to color 2 and from color 2 to color 3. The ramp will initially have 2 colors (black and white), one (black) at ramp lower offset 0 and the other (white) at the ramp higher offset 1.
  8. </description>
  9. <tutorials>
  10. </tutorials>
  11. <methods>
  12. <method name="add_point">
  13. <return type="void">
  14. </return>
  15. <argument index="0" name="offset" type="float">
  16. </argument>
  17. <argument index="1" name="color" type="Color">
  18. </argument>
  19. <description>
  20. Adds the specified color to the end of the ramp, with the specified offset.
  21. </description>
  22. </method>
  23. <method name="get_color" qualifiers="const">
  24. <return type="Color">
  25. </return>
  26. <argument index="0" name="point" type="int">
  27. </argument>
  28. <description>
  29. Returns the color of the ramp color at index [code]point[/code].
  30. </description>
  31. </method>
  32. <method name="get_offset" qualifiers="const">
  33. <return type="float">
  34. </return>
  35. <argument index="0" name="point" type="int">
  36. </argument>
  37. <description>
  38. Returns the offset of the ramp color at index [code]point[/code].
  39. </description>
  40. </method>
  41. <method name="get_point_count" qualifiers="const">
  42. <return type="int">
  43. </return>
  44. <description>
  45. Returns the number of colors in the ramp.
  46. </description>
  47. </method>
  48. <method name="interpolate">
  49. <return type="Color">
  50. </return>
  51. <argument index="0" name="offset" type="float">
  52. </argument>
  53. <description>
  54. Returns the interpolated color specified by [code]offset[/code].
  55. </description>
  56. </method>
  57. <method name="remove_point">
  58. <return type="void">
  59. </return>
  60. <argument index="0" name="offset" type="int">
  61. </argument>
  62. <description>
  63. Removes the color at the index [code]offset[/code].
  64. </description>
  65. </method>
  66. <method name="set_color">
  67. <return type="void">
  68. </return>
  69. <argument index="0" name="point" type="int">
  70. </argument>
  71. <argument index="1" name="color" type="Color">
  72. </argument>
  73. <description>
  74. Sets the color of the ramp color at index [code]point[/code].
  75. </description>
  76. </method>
  77. <method name="set_offset">
  78. <return type="void">
  79. </return>
  80. <argument index="0" name="point" type="int">
  81. </argument>
  82. <argument index="1" name="offset" type="float">
  83. </argument>
  84. <description>
  85. Sets the offset for the ramp color at index [code]point[/code].
  86. </description>
  87. </method>
  88. </methods>
  89. <members>
  90. <member name="colors" type="PoolColorArray" setter="set_colors" getter="get_colors" default="PoolColorArray( 0, 0, 0, 1, 1, 1, 1, 1 )">
  91. Gradient's colors returned as a [PoolColorArray].
  92. </member>
  93. <member name="offsets" type="PoolRealArray" setter="set_offsets" getter="get_offsets" default="PoolRealArray( 0, 1 )">
  94. Gradient's offsets returned as a [PoolRealArray].
  95. </member>
  96. </members>
  97. <constants>
  98. </constants>
  99. </class>