class_colorpicker.rst 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  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:`presets_enabled<class_ColorPicker_property_presets_enabled>` |
  22. +---------------------------+--------------------------------------------------------------------+
  23. | :ref:`bool<class_bool>` | :ref:`presets_visible<class_ColorPicker_property_presets_visible>` |
  24. +---------------------------+--------------------------------------------------------------------+
  25. | :ref:`bool<class_bool>` | :ref:`raw_mode<class_ColorPicker_property_raw_mode>` |
  26. +---------------------------+--------------------------------------------------------------------+
  27. Methods
  28. -------
  29. +---------------------------------------------+--------------------------------------------------------------------------------------------------------+
  30. | void | :ref:`add_preset<class_ColorPicker_method_add_preset>` **(** :ref:`Color<class_Color>` color **)** |
  31. +---------------------------------------------+--------------------------------------------------------------------------------------------------------+
  32. | void | :ref:`erase_preset<class_ColorPicker_method_erase_preset>` **(** :ref:`Color<class_Color>` color **)** |
  33. +---------------------------------------------+--------------------------------------------------------------------------------------------------------+
  34. | :ref:`PoolColorArray<class_PoolColorArray>` | :ref:`get_presets<class_ColorPicker_method_get_presets>` **(** **)** const |
  35. +---------------------------------------------+--------------------------------------------------------------------------------------------------------+
  36. Theme Properties
  37. ----------------
  38. +-------------------------------+---------------+
  39. | :ref:`Texture<class_Texture>` | add_preset |
  40. +-------------------------------+---------------+
  41. | :ref:`Texture<class_Texture>` | color_hue |
  42. +-------------------------------+---------------+
  43. | :ref:`Texture<class_Texture>` | color_sample |
  44. +-------------------------------+---------------+
  45. | :ref:`int<class_int>` | h_width |
  46. +-------------------------------+---------------+
  47. | :ref:`int<class_int>` | label_width |
  48. +-------------------------------+---------------+
  49. | :ref:`int<class_int>` | margin |
  50. +-------------------------------+---------------+
  51. | :ref:`Texture<class_Texture>` | preset_bg |
  52. +-------------------------------+---------------+
  53. | :ref:`Texture<class_Texture>` | screen_picker |
  54. +-------------------------------+---------------+
  55. | :ref:`int<class_int>` | sv_height |
  56. +-------------------------------+---------------+
  57. | :ref:`int<class_int>` | sv_width |
  58. +-------------------------------+---------------+
  59. Signals
  60. -------
  61. .. _class_ColorPicker_signal_color_changed:
  62. - **color_changed** **(** :ref:`Color<class_Color>` color **)**
  63. Emitted when the color is changed.
  64. .. _class_ColorPicker_signal_preset_added:
  65. - **preset_added** **(** :ref:`Color<class_Color>` color **)**
  66. Emitted when a preset is added.
  67. .. _class_ColorPicker_signal_preset_removed:
  68. - **preset_removed** **(** :ref:`Color<class_Color>` color **)**
  69. Emitted when a preset is removed.
  70. Description
  71. -----------
  72. :ref:`Control<class_Control>` node displaying a color picker widget. It's useful for selecting a color from an RGB/RGBA colorspace.
  73. Property Descriptions
  74. ---------------------
  75. .. _class_ColorPicker_property_color:
  76. - :ref:`Color<class_Color>` **color**
  77. +----------+-----------------------+
  78. | *Setter* | set_pick_color(value) |
  79. +----------+-----------------------+
  80. | *Getter* | get_pick_color() |
  81. +----------+-----------------------+
  82. The currently selected color.
  83. .. _class_ColorPicker_property_deferred_mode:
  84. - :ref:`bool<class_bool>` **deferred_mode**
  85. +----------+--------------------------+
  86. | *Setter* | set_deferred_mode(value) |
  87. +----------+--------------------------+
  88. | *Getter* | is_deferred_mode() |
  89. +----------+--------------------------+
  90. 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).
  91. .. _class_ColorPicker_property_edit_alpha:
  92. - :ref:`bool<class_bool>` **edit_alpha**
  93. +----------+-----------------------+
  94. | *Setter* | set_edit_alpha(value) |
  95. +----------+-----------------------+
  96. | *Getter* | is_editing_alpha() |
  97. +----------+-----------------------+
  98. If ``true``, shows an alpha channel slider (transparency).
  99. .. _class_ColorPicker_property_presets_enabled:
  100. - :ref:`bool<class_bool>` **presets_enabled**
  101. +----------+----------------------------+
  102. | *Setter* | set_presets_enabled(value) |
  103. +----------+----------------------------+
  104. | *Getter* | are_presets_enabled() |
  105. +----------+----------------------------+
  106. .. _class_ColorPicker_property_presets_visible:
  107. - :ref:`bool<class_bool>` **presets_visible**
  108. +----------+----------------------------+
  109. | *Setter* | set_presets_visible(value) |
  110. +----------+----------------------------+
  111. | *Getter* | are_presets_visible() |
  112. +----------+----------------------------+
  113. .. _class_ColorPicker_property_raw_mode:
  114. - :ref:`bool<class_bool>` **raw_mode**
  115. +----------+---------------------+
  116. | *Setter* | set_raw_mode(value) |
  117. +----------+---------------------+
  118. | *Getter* | is_raw_mode() |
  119. +----------+---------------------+
  120. 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).
  121. Method Descriptions
  122. -------------------
  123. .. _class_ColorPicker_method_add_preset:
  124. - void **add_preset** **(** :ref:`Color<class_Color>` color **)**
  125. 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. Note: the presets list is only for *this* color picker.
  126. .. _class_ColorPicker_method_erase_preset:
  127. - void **erase_preset** **(** :ref:`Color<class_Color>` color **)**
  128. Remove the given color from the list of color presets of this color picker.
  129. .. _class_ColorPicker_method_get_presets:
  130. - :ref:`PoolColorArray<class_PoolColorArray>` **get_presets** **(** **)** const
  131. Return the list of colors in the presets of the color picker.