Color¶
- class widgets.Color(py_color)¶
A
Colorobject represents a color to be displayed on screen.Example:
import widgets as wd # RGB black = wd.Color.rgb(0, 0, 0, 1) # White white = wd.Color.white(1, 1) # Dynamic background = wd.Color.dynamic(light=white, dark=black)
- alpha() float¶
Returns the alpha value of the color.
- Return type:
float
- blue() float¶
Returns the blue value of the color.
- Return type:
float
- classmethod dynamic(light: 'widgets.Color', dark: 'widgets.Color') 'widgets.Color'¶
Initializes and returns a color that dynamically changes in dark or light mode.
- green() float¶
Returns the green value of the color.
- Return type:
float
- red() float¶
Returns the red value of the color.
- Return type:
float
- classmethod rgb(red: float, green: float, blue: float, alpha: float = 1.0) 'widgets.Color'¶
Initializes a color from RGB values.
All values should be located between 0 and 1, not between 0 and 255.
- Parameters:
red – The red value.
green – The geen value.
blue – The blue value.
alpha – The opacity value.
- Return type: