class_colorpicker.rst 6.4 KB

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