Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

morpc.color Demo

Import morpc package

2026-01-26 11:37:13,030 | INFO | morpc.logs.config_logs: Set up logging save to file temp_data/color-demo.log

All Colors

<Figure size 600x200 with 1 Axes>
<Figure size 600x200 with 1 Axes>
<Figure size 600x200 with 1 Axes>
<Figure size 600x200 with 1 Axes>
<Figure size 600x200 with 1 Axes>
<Figure size 600x200 with 1 Axes>
<Figure size 600x200 with 1 Axes>
<Figure size 600x200 with 1 Axes>
<Figure size 600x200 with 1 Axes>
<Figure size 600x200 with 1 Axes>
<Figure size 600x200 with 1 Axes>
<Figure size 600x200 with 1 Axes>
<Figure size 600x200 with 1 Axes>

Get colors with morpc.color.GetColors

Get standard HEX color codes

The GetColors class provides access to a json file that contains various useful definitions of colors. It takes one argument colorDictPath='../morpc/color/morpc_colors.json' which is the relative path to the json file.

The json file is stored in the attribute morpc_colors.

{'KEY': '#B4AFAF', 'WG1': '#3d3d3d', 'WG2': '#656363', 'WG3': '#8B8989', 'WG4': '#B4AFAF', 'WG5': '#CDC9C9', 'WG6': '#EEE9E9'}

Key Colors

The standard colors are retrieved using .KEYS instance.

{'Green': '#8DC63F', 'Forest': '#2F6338', 'Sky': '#74C3D5', 'Blue': '#064A8C', 'Ocean': '#0E4A5A', 'Navy': '#1A2E59', 'Brown': '#9A7E6D', 'Yellow': '#FFD912', 'Orange': '#DD6226', 'Red': '#C61A35', 'Purple': '#6B4A92', 'WarmGrey': '#B4AFAF', 'CoolGrey': '#AFB7BC'}

Plot color strips from hex lists to see colors

You can plot a list of hex codes using the plot_from_hex_list() function. In the following example, we pass the values of the key colors to see them. The plot includes the HLS values, a grey values, and the hex code.

<Figure size 1300x200 with 1 Axes>

Sequential color gradients for each color

Each color has an associated gradient. These gradients can be returned using the .SEQ() function. Simply pass the color name to the funcion.

['#001908', '#0e3219', '#1d4c2a', '#265731', '#2e6237', '#357041', '#3b7e4a', '#539c66', '#69b981', '#91cca0', '#b8dfbf']
<Figure size 1100x200 with 1 Axes>

Two color sequential gradients

Pass a list of two color names to .SEQ2() method to get a split gradient.

<Figure size 1100x200 with 1 Axes>
<Figure size 1100x200 with 1 Axes>

Use hex_list_r to reverse the gradient

<Figure size 1100x200 with 1 Axes>

Three color sequential gradients

The same can be done with three colors using .SEQ3() method.

<Figure size 1100x200 with 1 Axes>
<Figure size 1100x200 with 1 Axes>
<Figure size 1100x200 with 1 Axes>
<Figure size 1100x200 with 1 Axes>

Diverging color gradients

Use the .DIV() method can be used to create diverging gradients and color maps.

<Figure size 700x200 with 1 Axes>

Qualitative color groups

Use the .QUAL() method to return groups for qualitative data. It selects a number of grouped lightness variations of each color.

['#1A2E59', '#8DC63F', '#064A8C', '#2F6338']
<Figure size 400x200 with 1 Axes>
<Figure size 800x200 with 1 Axes>

Testing color maps for color blindness accessibility

Loading...
<Figure size 640x480 with 2 Axes>
<Figure size 640x480 with 2 Axes>

DEPRECIATED - Update to MORP Color Palette

Purple

Red

Tan

Yellow

Light Green

Dark Blue

Mid Blue

Blue

Bluegreen

Dark Green

Dark grey

Light Grey

Build JSON