Skip to content

Configuration File

Al edited this page Jul 9, 2024 · 4 revisions

Generating a Configuration File

The default configuration file can be generated by using the provided PyPalEx option:

palex -g
palex --gen-config

Manually Creating a Configuration File

If you would like to create this file manually then please name it palex-config.yaml and store it in the proper location on your system. If you would like to know where to store your PyPalEx configuration file please use the provided PyPalEx option, it will tell you exactly where to save it.

palex -w
palex --where

The Default Configuration File

save-check: true
show-preview: true
export-file-format: json
export-color-format: hex
exported-palettes:
    light-theme:
        palette-type: light
        color1: red
        color2: green
        color3: yellow
        color4: blue
        color5: magenta
        color6: cyan
        color9: dark red
        color10: dark green
        color11: dark yellow
        color12: dark blue
        color13: dark magenta
        color14: dark cyan
    dark-theme:
        palette-type: dark
        color1: red
        color2: green
        color3: yellow
        color4: blue
        color5: magenta
        color6: cyan
        color9: light red
        color10: light green
        color11: light yellow
        color12: light blue
        color13: light magenta
        color14: light cyan

Configuration File Notes

save-check                : Ask the user if they want to save the extracted palette - [True / False]
show-preview           : Show preview of extracted palette(s) before saving - [True / False]
export-file-format    : Export file format options - ['json', 'yaml']
export-color-format : Export color format options - ['hex', 'rgb', 'hsv', 'ansi']
exported-palettes    : Dictionary of palette templates to organize after extraction.

  • Each palette MUST have a name (e.g. 'light-theme', 'dark-theme', 'mixed-light-theme', etc.).
  • Each palette MUST specify what 'palette-type' it is : ('light' or 'dark').
  • Each palette MUST specify Standard ANSI colors 1 through 6.
  • Each palette MUST specify High-Intensity ANSI colors 9 through 14.
  • More about ANSI colors at : https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit

NOTE ABOUT PALETTES :

  • Palette Templates is just another way of saying Color Theme Templates or Color Scheme Templates.

Palette Templates

Consider the following example of palette templates:

exported-palettes:
    light-theme:
        palette-type: light
        [ . . . ]
    dark-theme:
        palette-type: dark
        [ . . . ]
    big-chungus:
        palette-type: dark
        [ . . . ]
    grub:
        palette-type: dark
        [ . . . ]
    sunray:
        palette-type: light
        [ . . . ]

Each of these templates have a name that will be used to name the exported file ['sunray', 'big-chungus', 'light-theme', etc.] as well as a palette type ['light' or 'dark'] that is used to specify what kind of palette theme you're going for. A 'light' palette type will give you a light background and dark foreground while a 'dark' palette type will give you a dark background and light foreground. If you exclude or mistype the palette-type specifier, the extracted palette will default to using a 'dark' palette type.

Colors Available for Palettes

  • red,             light red,             dark red
  • yellow,        light yellow,        dark yellow
  • green,        light green,         dark green
  • cyan,          light cyan,          dark cyan
  • blue,           light blue,           dark blue
  • magenta,   light magenta,   dark magenta

NOTE ABOUT COLORS :

  • Color Codes color0, color7, color8 and color15, as well as the background and foreground, have been excluded as they are hard-coded and dependent on the dominant color in the image.
  • If you mistype one of the color names or Color Codes PyPalEx will automatically default to using black for that Color Code to avoid running into errors.