Data

Summary

color_from_rgba8

Create a ColorRGBA from 0-255 channel values.

color_from_hex

Create a ColorRGBA from a hex color string.

import_color_from_dpg

Create a ColorRGBA from DPG color data.

export_color_to_dpg

Convert a ColorRGBA-like iterable into DPG color data (list of floats 0-255)

ColorRGBA

RGBA color data.

MINYEAR

the smallest year number supported by DPG.

MAXYEAR

the largest year number supported by DPG.

import_date_from_dpg

Convert date data used by DPG into a date object.

export_date_to_dpg

Convert a date into date data used by DPG.

Colors

dearpygui_obj.data.color_from_rgba8(r: number, g: number, b: number, a: number = 255) ColorRGBA[source]

Create a ColorRGBA from 0-255 channel values.

dearpygui_obj.data.color_from_hex(color: str) dearpygui_obj.data.ColorRGBA[source]

Create a ColorRGBA from 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: tuple

RGBA 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(), and color_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 date object.

dearpygui_obj.data.export_date_to_dpg(date_val: date) Mapping[source]

Convert a date into date data used by DPG.

Unfortunately the range of year numbers supported by DPG is smaller than that of python. See the MINYEAR and MAXYEAR constants.

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).