InforcehubColors

This provides simple utilities to return inforcehub branded colors for use across applications such as matplotlib.

Usage

Import the color class and create an instance:

from inforcehub import InforcehubColors

ifh = InforcehubColors()

On this you can then get the specific colors by name:

ifh.pink                # Hex code for our pink
ifh.blue                # Hex code for our blue

Or you can see the list of colors available:

ifh.show()              # Names of all colors and neutrals
ifh.show('core')        # Names of core colors only
ifh.show('neutral')     # Names of neutral colors only

Or you can get multiple color hexcodes in a list:

ifh.list()              # Hex codes for everything
ifh.list('core')        # Hex codes for core colors
ifh.list('colors')      # Hex codes for all colors
ifh.list('neutral')     # Hex codes for neutral colors

Note that these methods are class methods on the InforcehubColors object. So you do not have to create an instance first. But we suggest doing it using an instance as above as it will keep your code neater.

Module details

class inforcehub.colors.InforcehubColors[source]

A class that will return the inforcehub brand colors as single hex codes or lists for use in various packages such as matplotlib.

The objective of this package is to make it easier and quicker to create consistent-looking charts using branded colors

classmethod list(sublist='all')[source]

Returns a list of the color hex codes for use in Matplotlib or other tools which want a set of colors to choose from

Param:str sublist: (default=’all’) options ‘colors’/’core’/’neutral’/’all’
Returns:a list of color hex codes
Return type:list
classmethod show(sublist='all')[source]

Returns a list of the color names

Param:str sublist: (default=’all’) options ‘colors’/’core’/’neutral’/’all’
Returns:a list of color names
Return type:list