Skip to main content

Basic Class containing Grafana Color constants

Project description

Grafana Color Constants

Use this package to easily get Grafana HEX color values in your code: grafana-colors.png

It also provides an easy way to iterate over these colors allowing for fast and flexible looping without hard-coding the colors in your code.

Install :

pip install grafana-color-constants

Example:

from grafana_color_constants import GrafanaColor

GrafanaColor.RED
>>> '#E02F44'
GrafanaColor.RED.normal
>>> '#E02F44'
GrafanaColor.RED.lighter
>>> '#FF7383'
GrafanaColor.PURPLE.darker
>>> '#7C2EA3'

You can use it as an iterator with th GrafanaColor.iterator property:

from grafana_color_constants import GrafanaColor
from matplotlib import pyplot as plt

color = GrafanaColor.iterator

for i in range(60):
    plt.bar([i+1], [1.05**i], color=next(color))
plt.show()

This will output a graph like so: graph-example.png

There are 6 colors: [RED, ORANGE, YELLOW, GREEN, BLUE, PURPLE], each with 5 shades [darker, dark, normal, light, lighter] for a total of 30 colors.

Hope it's useful to you!

#TODOs for next iterations:

  • rgb and rgba conversions
  • different iteration orders
  • custom color sets

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

grafana_color_constants-0.1.1.tar.gz (3.4 kB view details)

Uploaded Source

Built Distribution

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

grafana_color_constants-0.1.1-py3-none-any.whl (3.3 kB view details)

Uploaded Python 3

File details

Details for the file grafana_color_constants-0.1.1.tar.gz.

File metadata

  • Download URL: grafana_color_constants-0.1.1.tar.gz
  • Upload date:
  • Size: 3.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.12

File hashes

Hashes for grafana_color_constants-0.1.1.tar.gz
Algorithm Hash digest
SHA256 a4e87b9a468225b6768510761c4f837e896adeccaf5419173681e951daac4a8f
MD5 65dc84e56cac54a8e442b54a3c13b16d
BLAKE2b-256 bdd7e40cf7b73ff74f4d5b32617e952916703f75291c27bf15c6a8f8521ca70a

See more details on using hashes here.

File details

Details for the file grafana_color_constants-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for grafana_color_constants-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0def870088773e43c6188f963fdb277b230e5fc8696b21d6120748630df6e71c
MD5 20649a2cc0ac1ce8576c1dda8605500f
BLAKE2b-256 1038ae590b29eebfca16ea848bf44f49a65ece2ee846b852e419109feadbd23f

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