class_colorpicker.rst 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225
  1. :github_url: hide
  2. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  3. .. DO NOT EDIT THIS FILE, but the ColorPicker.xml source instead.
  4. .. The source is found in doc/classes or modules/<name>/doc_classes.
  5. .. _class_ColorPicker:
  6. ColorPicker
  7. ===========
  8. **Inherits:** :ref:`BoxContainer<class_BoxContainer>` **<** :ref:`Container<class_Container>` **<** :ref:`Control<class_Control>` **<** :ref:`CanvasItem<class_CanvasItem>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  9. **Category:** Core
  10. Brief Description
  11. -----------------
  12. Color picker control.
  13. Properties
  14. ----------
  15. +---------------------------+--------------------------------------------------------------------+---------------------+
  16. | :ref:`Color<class_Color>` | :ref:`color<class_ColorPicker_property_color>` | Color( 1, 1, 1, 1 ) |
  17. +---------------------------+--------------------------------------------------------------------+---------------------+
  18. | :ref:`bool<class_bool>` | :ref:`deferred_mode<class_ColorPicker_property_deferred_mode>` | false |
  19. +---------------------------+--------------------------------------------------------------------+---------------------+
  20. | :ref:`bool<class_bool>` | :ref:`edit_alpha<class_ColorPicker_property_edit_alpha>` | true |
  21. +---------------------------+--------------------------------------------------------------------+---------------------+
  22. | :ref:`bool<class_bool>` | :ref:`hsv_mode<class_ColorPicker_property_hsv_mode>` | false |
  23. +---------------------------+--------------------------------------------------------------------+---------------------+
  24. | :ref:`bool<class_bool>` | :ref:`presets_enabled<class_ColorPicker_property_presets_enabled>` | true |
  25. +---------------------------+--------------------------------------------------------------------+---------------------+
  26. | :ref:`bool<class_bool>` | :ref:`presets_visible<class_ColorPicker_property_presets_visible>` | true |
  27. +---------------------------+--------------------------------------------------------------------+---------------------+
  28. | :ref:`bool<class_bool>` | :ref:`raw_mode<class_ColorPicker_property_raw_mode>` | false |
  29. +---------------------------+--------------------------------------------------------------------+---------------------+
  30. Methods
  31. -------
  32. +---------------------------------------------+--------------------------------------------------------------------------------------------------------+
  33. | void | :ref:`add_preset<class_ColorPicker_method_add_preset>` **(** :ref:`Color<class_Color>` color **)** |
  34. +---------------------------------------------+--------------------------------------------------------------------------------------------------------+
  35. | void | :ref:`erase_preset<class_ColorPicker_method_erase_preset>` **(** :ref:`Color<class_Color>` color **)** |
  36. +---------------------------------------------+--------------------------------------------------------------------------------------------------------+
  37. | :ref:`PoolColorArray<class_PoolColorArray>` | :ref:`get_presets<class_ColorPicker_method_get_presets>` **(** **)** const |
  38. +---------------------------------------------+--------------------------------------------------------------------------------------------------------+
  39. Theme Properties
  40. ----------------
  41. +-------------------------------+---------------+-----+
  42. | :ref:`Texture<class_Texture>` | add_preset | |
  43. +-------------------------------+---------------+-----+
  44. | :ref:`Texture<class_Texture>` | color_hue | |
  45. +-------------------------------+---------------+-----+
  46. | :ref:`Texture<class_Texture>` | color_sample | |
  47. +-------------------------------+---------------+-----+
  48. | :ref:`int<class_int>` | h_width | 30 |
  49. +-------------------------------+---------------+-----+
  50. | :ref:`int<class_int>` | label_width | 10 |
  51. +-------------------------------+---------------+-----+
  52. | :ref:`int<class_int>` | margin | 4 |
  53. +-------------------------------+---------------+-----+
  54. | :ref:`Texture<class_Texture>` | preset_bg | |
  55. +-------------------------------+---------------+-----+
  56. | :ref:`Texture<class_Texture>` | screen_picker | |
  57. +-------------------------------+---------------+-----+
  58. | :ref:`int<class_int>` | sv_height | 256 |
  59. +-------------------------------+---------------+-----+
  60. | :ref:`int<class_int>` | sv_width | 256 |
  61. +-------------------------------+---------------+-----+
  62. Signals
  63. -------
  64. .. _class_ColorPicker_signal_color_changed:
  65. - **color_changed** **(** :ref:`Color<class_Color>` color **)**
  66. Emitted when the color is changed.
  67. .. _class_ColorPicker_signal_preset_added:
  68. - **preset_added** **(** :ref:`Color<class_Color>` color **)**
  69. Emitted when a preset is added.
  70. .. _class_ColorPicker_signal_preset_removed:
  71. - **preset_removed** **(** :ref:`Color<class_Color>` color **)**
  72. Emitted when a preset is removed.
  73. Description
  74. -----------
  75. :ref:`Control<class_Control>` node displaying a color picker widget. It's useful for selecting a color from an RGB/RGBA colorspace.
  76. Property Descriptions
  77. ---------------------
  78. .. _class_ColorPicker_property_color:
  79. - :ref:`Color<class_Color>` **color**
  80. +-----------+-----------------------+
  81. | *Default* | Color( 1, 1, 1, 1 ) |
  82. +-----------+-----------------------+
  83. | *Setter* | set_pick_color(value) |
  84. +-----------+-----------------------+
  85. | *Getter* | get_pick_color() |
  86. +-----------+-----------------------+
  87. The currently selected color.
  88. .. _class_ColorPicker_property_deferred_mode:
  89. - :ref:`bool<class_bool>` **deferred_mode**
  90. +-----------+--------------------------+
  91. | *Default* | false |
  92. +-----------+--------------------------+
  93. | *Setter* | set_deferred_mode(value) |
  94. +-----------+--------------------------+
  95. | *Getter* | is_deferred_mode() |
  96. +-----------+--------------------------+
  97. If ``true``, 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).
  98. .. _class_ColorPicker_property_edit_alpha:
  99. - :ref:`bool<class_bool>` **edit_alpha**
  100. +-----------+-----------------------+
  101. | *Default* | true |
  102. +-----------+-----------------------+
  103. | *Setter* | set_edit_alpha(value) |
  104. +-----------+-----------------------+
  105. | *Getter* | is_editing_alpha() |
  106. +-----------+-----------------------+
  107. If ``true``, shows an alpha channel slider (transparency).
  108. .. _class_ColorPicker_property_hsv_mode:
  109. - :ref:`bool<class_bool>` **hsv_mode**
  110. +-----------+---------------------+
  111. | *Default* | false |
  112. +-----------+---------------------+
  113. | *Setter* | set_hsv_mode(value) |
  114. +-----------+---------------------+
  115. | *Getter* | is_hsv_mode() |
  116. +-----------+---------------------+
  117. If ``true``, allows editing the color with Hue/Saturation/Value sliders.
  118. **Note:** Cannot be enabled if raw mode is on.
  119. .. _class_ColorPicker_property_presets_enabled:
  120. - :ref:`bool<class_bool>` **presets_enabled**
  121. +-----------+----------------------------+
  122. | *Default* | true |
  123. +-----------+----------------------------+
  124. | *Setter* | set_presets_enabled(value) |
  125. +-----------+----------------------------+
  126. | *Getter* | are_presets_enabled() |
  127. +-----------+----------------------------+
  128. .. _class_ColorPicker_property_presets_visible:
  129. - :ref:`bool<class_bool>` **presets_visible**
  130. +-----------+----------------------------+
  131. | *Default* | true |
  132. +-----------+----------------------------+
  133. | *Setter* | set_presets_visible(value) |
  134. +-----------+----------------------------+
  135. | *Getter* | are_presets_visible() |
  136. +-----------+----------------------------+
  137. .. _class_ColorPicker_property_raw_mode:
  138. - :ref:`bool<class_bool>` **raw_mode**
  139. +-----------+---------------------+
  140. | *Default* | false |
  141. +-----------+---------------------+
  142. | *Setter* | set_raw_mode(value) |
  143. +-----------+---------------------+
  144. | *Getter* | is_raw_mode() |
  145. +-----------+---------------------+
  146. If ``true``, 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).
  147. **Note:** Cannot be enabled if HSV mode is on.
  148. Method Descriptions
  149. -------------------
  150. .. _class_ColorPicker_method_add_preset:
  151. - void **add_preset** **(** :ref:`Color<class_Color>` color **)**
  152. 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.
  153. **Note:** the presets list is only for *this* color picker.
  154. .. _class_ColorPicker_method_erase_preset:
  155. - void **erase_preset** **(** :ref:`Color<class_Color>` color **)**
  156. Removes the given color from the list of color presets of this color picker.
  157. .. _class_ColorPicker_method_get_presets:
  158. - :ref:`PoolColorArray<class_PoolColorArray>` **get_presets** **(** **)** const
  159. Returns the list of colors in the presets of the color picker.