Gradient.xml 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="Gradient" inherits="Resource" version="3.3">
  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. <argument index="0" name="offset" type="float" />
  15. <argument index="1" name="color" type="Color" />
  16. <description>
  17. Adds the specified color to the end of the ramp, with the specified offset.
  18. </description>
  19. </method>
  20. <method name="get_color">
  21. <return type="Color" />
  22. <argument index="0" name="point" type="int" />
  23. <description>
  24. Returns the color of the ramp color at index [code]point[/code].
  25. </description>
  26. </method>
  27. <method name="get_offset">
  28. <return type="float" />
  29. <argument index="0" name="point" type="int" />
  30. <description>
  31. Returns the offset of the ramp color at index [code]point[/code].
  32. </description>
  33. </method>
  34. <method name="get_point_count" qualifiers="const">
  35. <return type="int" />
  36. <description>
  37. Returns the number of colors in the ramp.
  38. </description>
  39. </method>
  40. <method name="interpolate">
  41. <return type="Color" />
  42. <argument index="0" name="offset" type="float" />
  43. <description>
  44. Returns the interpolated color specified by [code]offset[/code].
  45. </description>
  46. </method>
  47. <method name="remove_point">
  48. <return type="void" />
  49. <argument index="0" name="point" type="int" />
  50. <description>
  51. Removes the color at the index [code]point[/code].
  52. </description>
  53. </method>
  54. <method name="set_color">
  55. <return type="void" />
  56. <argument index="0" name="point" type="int" />
  57. <argument index="1" name="color" type="Color" />
  58. <description>
  59. Sets the color of the ramp color at index [code]point[/code].
  60. </description>
  61. </method>
  62. <method name="set_offset">
  63. <return type="void" />
  64. <argument index="0" name="point" type="int" />
  65. <argument index="1" name="offset" type="float" />
  66. <description>
  67. Sets the offset for the ramp color at index [code]point[/code].
  68. </description>
  69. </method>
  70. </methods>
  71. <members>
  72. <member name="colors" type="PoolColorArray" setter="set_colors" getter="get_colors" default="PoolColorArray( 0, 0, 0, 1, 1, 1, 1, 1 )">
  73. Gradient's colors returned as a [PoolColorArray].
  74. </member>
  75. <member name="offsets" type="PoolRealArray" setter="set_offsets" getter="get_offsets" default="PoolRealArray( 0, 1 )">
  76. Gradient's offsets returned as a [PoolRealArray].
  77. </member>
  78. </members>
  79. <constants>
  80. </constants>
  81. </class>