Skip to main content

hsla, rgba, colour palettes

Project description

lifehacks.colour publish

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

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.0.1.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

lifehacks.colour-1.0.1-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

Details for the file lifehacks.colour-1.0.1.tar.gz.

File metadata

  • Download URL: lifehacks.colour-1.0.1.tar.gz
  • Upload date:
  • Size: 4.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for lifehacks.colour-1.0.1.tar.gz
Algorithm Hash digest
SHA256 bc8229f1027b5b5a9faa2e52c09702e8ea1ca9e3e1f35942ee3cc55bed2701a3
MD5 09ca2dde9c9301e3d49f8da631247324
BLAKE2b-256 66d7be17711bc5e6e5d33a6cb48d5a66c1b5d128bdd0077d78d4cac2ebdb0e00

See more details on using hashes here.

File details

Details for the file lifehacks.colour-1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for lifehacks.colour-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ecd55f11cec2c6cc65119cad5e38e972d877e1e526597dceb1245028e5fb605e
MD5 602ad349623e530309cec876dd6e1a17
BLAKE2b-256 c868bdf3bbf3c2ec4a5fbb6e45e0a0713772b552aa8879533b60d28ecffb2918

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page