Skip to content

Add a qoolqit.utils.colors module with the qoolqit palette and colormaps #427

Description

@alessandro-santini

Add a qoolqit.utils.colors module that makes the qoolqit palette and a set of colormaps available to matplotlib by name, so documentation plots can be consistent without copy-pasted hex values.

The module is purely additive: importing it registers extra names but never modifies rcParams, so existing plots keep their current appearance. Colors are applied only where they are asked for explicitly.

Motivation

Docs plots currently use matplotlib's default colors, and any styling is redone by hand in each notebook. A single module in the package removes the duplicated hex values and gives one obvious place to look up the palette.

Proposed approach

  • Add qoolqit/utils/colors.py defining PALETTE (a dict of name -> hex), the diverging/sequential colormaps, and two suggested color cycles
  • On import, register the palette as named colors (bare mint_green) and the colormaps under the qq_ prefix
  • Usage: from qoolqit.utils import colors, then color="mint_green" / cmap="qq_purple_mint"

Palette

Name Hex Name Hex
dark_green #0F1E23 neon_blue #92C8E5
soft_green #173035 neon_purple #867BFA
bright_green #E1F6E9 soft_orange #FF986E
mint_green #00C887 neutral_gray #506166
metal_blue #397378

All keys use the <qualifier>_<hue> form. None of matplotlib's ~1160 built-in color names contain an underscore, so these cannot collide with a built-in now or later; this is why purple and orange became neon_purple and soft_orange.

Colormaps

qq_<low>_<high> for diverging, qq_<hue> for sequential, _dark for the dark-center variant, _r for reversed.

  • Diverging: qq_purple_mint, qq_orange_mint, qq_purple_orange, qq_blue_mint, each with a _dark variant
  • Sequential: qq_mint, qq_purple, qq_orange, qq_deep, qq_night

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions