2
0

class_colorpicker.rst 6.5 KB

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