Colour, hsla, rgba, palette
Project description
lifehacks.colour
Structure
📦 lifehacks.colour
├── Colour
├── hsla
├── rgba
│
└── 📦 palette
├── Apple
└── Mariana
Installation
pip install lifehacks.colour
Usage
Colour
abstract class
Abstract base class, not instantiable.
Can be used in type hinting for hsla
and rgba
instances
def print_hex(colour:Colour) -> None:
print(colour.to_hex())
print_hex(rgba(15, 15, 15)) #0f0f0f
print_hex(hsla( 0, 0, 6)) #0f0f0f
hsla
- optional
h
: hue[0, 359]
- optional
s
: saturation[0, 100]
or[0.0, 1.0]
- optional
l
: lightness[0, 100]
or[0.0, 1.0]
- optional
a
: alpha (opacity)[0, 100]
or[0.0, 1.0]
rgba
- optional
r
: red[0, 255]
- optional
g
: green[0, 255]
- optional
b
: blue[0, 255]
- optional
a
: alpha[0, 100]
or[0.0, 1.0]
Mariana
palette
Remember to import from lifehacks.colour.palette
.
This palette contains the colours from Mariana theme in Sublime Text.
from lifhacks.colour.palette import Mariana
for name, colour in Mariana:
content = content.replace(name, colour.to_hex())
Contributors
- Simon - mightbesimon
- you?
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
lifehacks.colour-1.1.0.tar.gz
(4.5 kB
view hashes)
Built Distribution
Close
Hashes for lifehacks.colour-1.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b123a89646251bdd092e6551b92de9e622a34fb4bf297f62c3e760aee87e7710 |
|
MD5 | 12e8175533f970f631b94a1442ec1cb3 |
|
BLAKE2b-256 | 9c3b7272e3e75ff30bc55344865d45416930e4efee69a5fded3320e01bc29c0d |