class_colorpicker.rst 8.1 KB

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