Data¶
Contents
Summary
Create a |
|
Create a |
|
Create a ColorRGBA from DPG color data. |
|
Convert a |
|
RGBA color data. |
|
the smallest year number supported by DPG. |
|
the largest year number supported by DPG. |
|
Convert date data used by DPG into a |
|
Convert a |
Colors¶
- dearpygui_obj.data.color_from_rgba8(r: number, g: number, b: number, a: number = 255) ColorRGBA[source]¶
Create a
ColorRGBAfrom 0-255 channel values.
- dearpygui_obj.data.color_from_hex(color: str) dearpygui_obj.data.ColorRGBA[source]¶
Create a
ColorRGBAfrom a hex color string.Supported formats (The “#” and alpha channel are optional):
“[#]RGB[A]” (hex shorthand format)
“[#]RRGGBB[AA]”
- dearpygui_obj.data.import_color_from_dpg(colorlist: List[number]) ColorRGBA[source]¶
Create a ColorRGBA from DPG color data.
- dearpygui_obj.data.export_color_to_dpg(color: Iterable[number]) List[number][source]¶
Convert a
ColorRGBA-like iterable into DPG color data (list of floats 0-255)
- class dearpygui_obj.data.ColorRGBA(r: number, g: number, b: number, a: number = 255)[source]¶
Bases:
tupleRGBA color data.
Values should be expressed in the range between 0 and 255 (since that’s what DPG uses). The alpha value is optional.
Using the
color_from_float(),color_from_rgba8(), andcolor_from_hex()constructor functions should be preferred over instantiating ColorRGBA tuples directly, as the internal representation may be subject to change.- r: number¶
red channel
- g: number¶
green channel
- b: number¶
blue channel
- a: number¶
alpha channel
Predefined Colors¶
A selection of predefined color values are available from the dearpygui_obj.colors module.
Date/Time¶
- dearpygui_obj.data.MINYEAR = 1970¶
the smallest year number supported by DPG.
- dearpygui_obj.data.MAXYEAR = 2999¶
the largest year number supported by DPG.
- dearpygui_obj.data.import_date_from_dpg(date_data: Mapping[str, int]) date[source]¶
Convert date data used by DPG into a
dateobject.
- dearpygui_obj.data.export_date_to_dpg(date_val: date) Mapping[source]¶
Convert a
dateinto date data used by DPG.Unfortunately the range of year numbers supported by DPG is smaller than that of python. See the
MINYEARandMAXYEARconstants.If a date outside of the supported range is given, this function will still return a value, however that value may not produce desired results when supplied to DPG’s date widgets (should get clamped).