/color_generator

A tool that generates a series of new colors that fit well with a given palette

Primary LanguagePython

Color Palette Extender

Table of Contents

  1. Rationale
  2. Source
  3. Usage
    1. Note
  4. Examples
    1. Plotting
      1. Original Palette Line
      2. Extended Palette Line
      3. Comparison Palettes
      4. Original Palette Joint
      5. Extended Palette Joint
      6. Original Palette Scatter
      7. Extended Palette Scatter
    2. Console
  5. Requirements

Rationale

Have you ever had a great color palette, but it didn't contain enough values to use for your (plot / website / theme / etc)?

This tool takes a color palette, and returns a set of new candidate colors that fit well

Source

This wonderful blog post:

https://matthewstrom.com/writing/how-to-pick-the-least-wrong-colors/

This repository takes his code (written in javascript) and implements it in python.

Usage

  1. Go to the directory

  2. Check that the Requirements: 5 are installed

  3. Add your colors to the `run.py` file

  4. Run it!

    python run.py

This will also show some example plots

Note

This is a probabilistic algorithm. If you don't get results you like, just run it again until you do!

Examples

You can run the `plotting.py` or `console.py` files to see different outputs:

Plotting

Original Palette Line

img

Extended Palette Line

img

Comparison Palettes

img

Original Palette Joint

img

Extended Palette Joint

img

Original Palette Scatter

img

Extended Palette Scatter

img

Console

img

Requirements

Currently too lazy to add an environment here. May update later

Main Functionality

numpy, matplotlib, colormath, cytoolz

Running Examples

rich, seaborn