Color#
- class blueprints.Color[source]#
Bases:
ColorTypeThe color descriptor can be one of the following:
string containing the colors name:
'orange'string containing the colors hex code as RGB:
'#FFFF00'string containing the colors hex code as RGBA:
'#FFFF0080'integer specifying the colors hex code as RGB
0xFFFF00list containing the colors components as RGB:
[1, 1, 0]list containing the colors components as RGBA:
[1, 1, 0, 0.5]np.array containing the colors components as RGB:
[1, 1, 0]np.array containing the colors components as RGBA:
[1, 1, 0, 0.5]Color object.
Attributes Summary
The name is set to be the closest name among default colors.
The value is synchronized with
rgba.The values are synchronized with
rgba,red,:attr:green andblue.The values are synchronized with
rgb,red,:attr:green,blueandopacity.Attributes Documentation
- blue#
The value is synchronized with
rgbandrgba.- Returns:
The blue component of the color array.
- Return type:
float | None
- green#
The value is synchronized with
rgbandrgba.- Returns:
The green component of the color array.
- Return type:
float | None
- name#
The name is set to be the closest name among default colors.
- Return type:
str
- opacity#
The value is synchronized with
rgba.- Returns:
The opacity component of the color array.
- Return type:
int | float
- red#
The value is synchronized with
rgbandrgba.- Returns:
The red component of the color array.
- Return type:
float | None
- rgb#
The values are synchronized with
rgba,red,:attr:green andblue.- Returns:
The color array without opacity.
- Return type:
np.ndarray
- rgba#
The values are synchronized with
rgb,red,:attr:green,blueandopacity.- Returns:
The color array with opacity.
- Return type:
np.ndarray
- __init__(descriptor, opacity=None)[source]#
- Parameters:
descriptor (str | int | list[int | float] | ndarray | ColorType)
opacity (int | float | None)
- classmethod __new__(*args, **kwargs)#