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: https://gitlab.com/calixtemayoraz/grafana-color-constants/-/raw/master/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: https://gitlab.com/calixtemayoraz/grafana-color-constants/-/raw/master/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.2.tar.gz (3.5 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.2-py3-none-any.whl (3.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: grafana_color_constants-0.1.2.tar.gz
  • Upload date:
  • Size: 3.5 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.2.tar.gz
Algorithm Hash digest
SHA256 63112a6bc52de915385e36773dbf8d3d6aebcbf0aabba54d3f41ab2c295e02fc
MD5 3d3ff39289eda736a8e3e13ef0c1707b
BLAKE2b-256 66c186d580b0d493d6ddf439e7bad287c8fb2fe3576a1ee73c2bc9700fd61978

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for grafana_color_constants-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 8bc0c0e1e8ad2c4cbecf284e329b6269b2c47f8cb0db980ca0bae51162dcd553
MD5 fce292100749ab8f6887c024776d7020
BLAKE2b-256 2ca820625adfef286d7c61d45e648cdfb76179344c7151e7273484bbd8c291fc

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