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
Add a
qoolqit.utils.colorsmodule 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
qoolqit/utils/colors.pydefiningPALETTE(adictof name -> hex), the diverging/sequential colormaps, and two suggested color cyclesmint_green) and the colormaps under theqq_prefixfrom qoolqit.utils import colors, thencolor="mint_green"/cmap="qq_purple_mint"Palette
dark_green#0F1E23neon_blue#92C8E5soft_green#173035neon_purple#867BFAbright_green#E1F6E9soft_orange#FF986Emint_green#00C887neutral_gray#506166metal_blue#397378All 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 whypurpleandorangebecameneon_purpleandsoft_orange.Colormaps
qq_<low>_<high>for diverging,qq_<hue>for sequential,_darkfor the dark-center variant,_rfor reversed.qq_purple_mint,qq_orange_mint,qq_purple_orange,qq_blue_mint, each with a_darkvariantqq_mint,qq_purple,qq_orange,qq_deep,qq_night