ColorPicker.xml 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="ColorPicker" inherits="BoxContainer" version="3.3">
  3. <brief_description>
  4. Color picker control.
  5. </brief_description>
  6. <description>
  7. [Control] node displaying a color picker widget. It's useful for selecting a color from an RGB/RGBA colorspace.
  8. </description>
  9. <tutorials>
  10. <link title="Tween Demo">https://godotengine.org/asset-library/asset/146</link>
  11. </tutorials>
  12. <methods>
  13. <method name="add_preset">
  14. <return type="void" />
  15. <argument index="0" name="color" type="Color" />
  16. <description>
  17. Adds the given color to a list of color presets. The presets are displayed in the color picker and the user will be able to select them.
  18. [b]Note:[/b] the presets list is only for [i]this[/i] color picker.
  19. </description>
  20. </method>
  21. <method name="erase_preset">
  22. <return type="void" />
  23. <argument index="0" name="color" type="Color" />
  24. <description>
  25. Removes the given color from the list of color presets of this color picker.
  26. </description>
  27. </method>
  28. <method name="get_presets" qualifiers="const">
  29. <return type="PoolColorArray" />
  30. <description>
  31. Returns the list of colors in the presets of the color picker.
  32. </description>
  33. </method>
  34. </methods>
  35. <members>
  36. <member name="color" type="Color" setter="set_pick_color" getter="get_pick_color" default="Color( 1, 1, 1, 1 )">
  37. The currently selected color.
  38. </member>
  39. <member name="deferred_mode" type="bool" setter="set_deferred_mode" getter="is_deferred_mode" default="false">
  40. If [code]true[/code], the color will apply only after the user releases the mouse button, otherwise it will apply immediately even in mouse motion event (which can cause performance issues).
  41. </member>
  42. <member name="edit_alpha" type="bool" setter="set_edit_alpha" getter="is_editing_alpha" default="true">
  43. If [code]true[/code], shows an alpha channel slider (transparency).
  44. </member>
  45. <member name="hsv_mode" type="bool" setter="set_hsv_mode" getter="is_hsv_mode" default="false">
  46. If [code]true[/code], allows editing the color with Hue/Saturation/Value sliders.
  47. [b]Note:[/b] Cannot be enabled if raw mode is on.
  48. </member>
  49. <member name="presets_enabled" type="bool" setter="set_presets_enabled" getter="are_presets_enabled" default="true">
  50. If [code]true[/code], the "add preset" button is enabled.
  51. </member>
  52. <member name="presets_visible" type="bool" setter="set_presets_visible" getter="are_presets_visible" default="true">
  53. If [code]true[/code], saved color presets are visible.
  54. </member>
  55. <member name="raw_mode" type="bool" setter="set_raw_mode" getter="is_raw_mode" default="false">
  56. If [code]true[/code], allows the color R, G, B component values to go beyond 1.0, which can be used for certain special operations that require it (like tinting without darkening or rendering sprites in HDR).
  57. [b]Note:[/b] Cannot be enabled if HSV mode is on.
  58. </member>
  59. </members>
  60. <signals>
  61. <signal name="color_changed">
  62. <argument index="0" name="color" type="Color" />
  63. <description>
  64. Emitted when the color is changed.
  65. </description>
  66. </signal>
  67. <signal name="preset_added">
  68. <argument index="0" name="color" type="Color" />
  69. <description>
  70. Emitted when a preset is added.
  71. </description>
  72. </signal>
  73. <signal name="preset_removed">
  74. <argument index="0" name="color" type="Color" />
  75. <description>
  76. Emitted when a preset is removed.
  77. </description>
  78. </signal>
  79. </signals>
  80. <constants>
  81. </constants>
  82. <theme_items>
  83. <theme_item name="add_preset" type="Texture">
  84. The icon for the "Add Preset" button.
  85. </theme_item>
  86. <theme_item name="color_hue" type="Texture">
  87. Custom texture for the hue selection slider on the right.
  88. </theme_item>
  89. <theme_item name="color_sample" type="Texture">
  90. </theme_item>
  91. <theme_item name="h_width" type="int" default="30">
  92. The width of the hue selection slider.
  93. </theme_item>
  94. <theme_item name="label_width" type="int" default="10">
  95. </theme_item>
  96. <theme_item name="margin" type="int" default="4">
  97. The margin around the [ColorPicker].
  98. </theme_item>
  99. <theme_item name="overbright_indicator" type="Texture">
  100. The indicator used to signalize that the color value is outside the 0-1 range.
  101. </theme_item>
  102. <theme_item name="preset_bg" type="Texture">
  103. </theme_item>
  104. <theme_item name="screen_picker" type="Texture">
  105. The icon for the screen color picker button.
  106. </theme_item>
  107. <theme_item name="sv_height" type="int" default="256">
  108. The height of the saturation-value selection box.
  109. </theme_item>
  110. <theme_item name="sv_width" type="int" default="256">
  111. The width of the saturation-value selection box.
  112. </theme_item>
  113. </theme_items>
  114. </class>