palette - Quick access to named CSS4 colours
- Purpose:
This class module provides quick-access to CSS-4 named colours in both RGB and hexidecimal formats.
- Platform:
Linux/Windows | Python 3.6+
- Developer:
J Berendt
- Email:
- Comments:
n/a
- Example:
Use the hex colour palette:
>>> from utils4.palette import hexpalette >>> hexpalette.aliceblue '#F0F8FF'
Use the RGB colour palette:
>>> from utils4.palette import rgbpalette >>> rgbpalette.aliceblue [240, 248, 255]
- class palette.CSS4Colours[source]
Lazy class container to hold the raw CSS level 4 colour name lookup.
- property colours
The 148 colour names from the CSS level 4 colour specification.
For example:
aliceblue
antiquewhite
aqua
…
whitesmoke
yellow
yellowgreen
- class palette.HexPalette[source]
Complete CSS-4 colour palette (in hex format), as object attributes.
- __init__()[source]
HexPalette class initialiser.
This initialiser dynamically creates all named colours as class attributes using the
CSS4Colours
class as its data source.
- class palette.RGBPalette[source]
Complete CSS-4 colour palette (in RGB format), as object attributes.
- __init__()[source]
RGBPalette class initialiser.
This initialiser dynamically creates all named colours as class attributes using the
CSS4Colours
class as its data source.