class_colorpicker.rst 4.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  2. .. DO NOT EDIT THIS FILE, but the doc/base/classes.xml source instead.
  3. .. _class_ColorPicker:
  4. ColorPicker
  5. ===========
  6. **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>`
  7. **Category:** Core
  8. Brief Description
  9. -----------------
  10. Color picker control.
  11. Member Functions
  12. ----------------
  13. +----------------------------+----------------------------------------------------------------------------------------------------+
  14. | void | :ref:`set_color<class_ColorPicker_set_color>` **(** :ref:`Color<class_color>` color **)** |
  15. +----------------------------+----------------------------------------------------------------------------------------------------+
  16. | :ref:`Color<class_color>` | :ref:`get_color<class_ColorPicker_get_color>` **(** **)** const |
  17. +----------------------------+----------------------------------------------------------------------------------------------------+
  18. | void | :ref:`set_raw_mode<class_ColorPicker_set_raw_mode>` **(** :ref:`bool<class_bool>` mode **)** |
  19. +----------------------------+----------------------------------------------------------------------------------------------------+
  20. | :ref:`bool<class_bool>` | :ref:`is_raw_mode<class_ColorPicker_is_raw_mode>` **(** **)** const |
  21. +----------------------------+----------------------------------------------------------------------------------------------------+
  22. | void | :ref:`set_edit_alpha<class_ColorPicker_set_edit_alpha>` **(** :ref:`bool<class_bool>` show **)** |
  23. +----------------------------+----------------------------------------------------------------------------------------------------+
  24. | :ref:`bool<class_bool>` | :ref:`is_editing_alpha<class_ColorPicker_is_editing_alpha>` **(** **)** const |
  25. +----------------------------+----------------------------------------------------------------------------------------------------+
  26. | void | :ref:`add_preset<class_ColorPicker_add_preset>` **(** :ref:`Color<class_color>` arg0 **)** |
  27. +----------------------------+----------------------------------------------------------------------------------------------------+
  28. Signals
  29. -------
  30. - **color_changed** **(** :ref:`Color<class_color>` color **)**
  31. Description
  32. -----------
  33. This is a simple color picker :ref:`Control<class_control>`. It's useful for selecting a color from an RGB/RGBA colorspace.
  34. Member Function Description
  35. ---------------------------
  36. .. _class_ColorPicker_set_color:
  37. - void **set_color** **(** :ref:`Color<class_color>` color **)**
  38. Select the current color.
  39. .. _class_ColorPicker_get_color:
  40. - :ref:`Color<class_color>` **get_color** **(** **)** const
  41. Return the current (edited) color.
  42. .. _class_ColorPicker_set_raw_mode:
  43. - void **set_raw_mode** **(** :ref:`bool<class_bool>` mode **)**
  44. When set to true, every color channel will be represented as a value from 0 to 1, insetead of 0, 255.
  45. .. _class_ColorPicker_is_raw_mode:
  46. - :ref:`bool<class_bool>` **is_raw_mode** **(** **)** const
  47. Returns whether this color picker is in raw mode or not
  48. .. _class_ColorPicker_set_edit_alpha:
  49. - void **set_edit_alpha** **(** :ref:`bool<class_bool>` show **)**
  50. Set true if you want the color to have an alpha channel (transparency), or false if you want a solid color.
  51. .. _class_ColorPicker_is_editing_alpha:
  52. - :ref:`bool<class_bool>` **is_editing_alpha** **(** **)** const
  53. Returns whether the color has transparency or not.
  54. .. _class_ColorPicker_add_preset:
  55. - void **add_preset** **(** :ref:`Color<class_color>` arg0 **)**
  56. Adds the current selected to color to a list of colors (presets), the presets will be displayed in the color picker and the user will be able to select them, notice that the presets list is only for this color picker.