Skip to content
Ilya V. Portnov edited this page Sep 4, 2016 · 19 revisions

Palette editor

This tool (python + Qt) is for matching colors, creating and editing palettes, color schemes and so on. In some way, it's ancestor of Agave, paletton.com and similar services, and in some way even Swatchbooker.

Basic features:

  • Editable palette. User specifies some colors on palette (indicated with small circle in slot), other colors are generated automatically by mixing given colors. There are several models of mixing colors: RGB, CMYK, HSV, HCY, Lab, LCh, and so on. There is also implementation of RYB color model (Red-Yellow-Blue).
  • Palette can be loaded/saved to/from several formats. It's possible to read/save CSS (only rules specifying colors are written). Palette can be saved as raster or SVG image. Palette can be loaded from SVG image (all colors of image are used) or from raster image (only most common colors from image are used). Potentially, other palette formats can be implemented — at least ones implemented in Swatchbooker.
  • Two color selectors: HCY wheel and hue ring with saturation/value square, which can work in HLS, HCY, RYB, LCh.
  • Several standard color harmonies (two opposite colors, three colors etc). With HCY wheel, you can move harmonized colors by dragging them, if select Harmony = Manual. For each of harmonzied colors several shades are generated (by lightness, by saturation and so on).
  • For palettes and colors, arbitrary metainformation attributes (such as name, author, copyright and so on) can be stored, see Palette -> Edit color/palette metainformation. See also Metainformation attributes.
  • Selected colors can be used to "automagically" colorize any selected SVG image (some templates are in distribution). Colors from source image are replaced with selected colors trying to save colors relationships: replace similar colors to similar, contrast to contrast. This feature is mainly to preview selected colors how they will work in more or less realistic composition, not just in rectangular table. Please see examples under Colorizing SVG templates.

Github: https://github.com/portnov/color-palette

License — GPLv2 or any later.

Short user manual

Palette editor GUI

Common usage tecniques

  • Colors can be drag-n-dropped between different slots and selectors.
  • In most places, color can be changed with mouse wheel:
    • Scroll to change saturation.
    • Shift+Scroll to change lightness.
    • Ctrl+Scroll to change color hue.
  • Right mouse click on slot clears that slot.
  • Context menu on color widgets is by default disabled, but can be enabled in preferences dialog.
  • Main areas are dock widgets, so you can move, resize, dock or undock them.

Mouse buttons used for different actions re configurable. See also Preferences.

Palette

Palette is a rectangular table with colors. Some of colors are explicitly defined by user; other are generated automatically by mixing given colors.

For colors mixing, several color models are supported:

  • RGB
  • HSV
  • HLS
  • HCY
  • HCY Desaturate - when mixing colors, straight segment on HCY color wheel is taken. So, when mixing saturated colors, you have less saturated color.
  • RYB - colors mixing on theoretical "Red-Yellow-Blue" color wheel. In particular, by this theory, red plus green gives gray, and blue plus yellow gives green.
  • CMYK
  • CMY - imitates "substractive" mixing of paints on paper, when mixing of relatively light colors gives more dark color, because more pigment is used.
  • HSI (experimental) - experimental mode, maybe someone will like it.
  • LCh
  • Lab.

Color mixing models preview

Colors in palette, which are marked with small circle in corner, are explicitly defined by user; other are generated automatically. You can put color into palette by drag-n-dropping it from somewhere. To mark color as user-defined or unmark it, click with right mouse button on it. You can drag-n-drop colors in palette, or from palette, or to/from other applications, such as MyPaint or Krita.

Palette can work in two modes: "locked" and "edit mode". Modes are toggled by button in the toolbar. In locked mode, you can only select colors from palette. In edit mode, you can also change colors, add or remove rows or columns. Two modes are designed to avoid accidential changes in palette.

Palettes can be saved or loaded from different formats. Currently supported are:

  • Gimp palettes (gpl) - read and write
  • XML palettes in CREATE format (from old MyPaint implementation) - read and write
  • XML palettes from paletton.com - read only
  • CSS files - read and write. NB: when saving CSS, only colors are saved, other rules are not.
  • Scribus XML color swatches files - read and write. It reads RGB and CMYK values, but writes only RGB.
  • SVG files - read and write. When saving, an image of table with square swatches is saved.
  • Adobe ASE files - read and write.
  • Adobe ACO files - read only.
  • Raster images (JPEG, PNG etc). When saving, an image of table with square swatches is saved. When opening a raster image, several options are available:
    • Load 9 most different colors from image and mix them
    • Load 9 most common colors from image and mix them
    • Load 49 most common colors from image
    • Read table of colors (something like this ).

See also Load palette from raster image options for examples.

Color picker

The "Pick" button allows you to select color from anywhere on the screen. To use the color picker tool:

  • Click "Pick" button. Text on the button will change to "Click and drag to pick a color". Mouse cursor will change shape to indicate area from which you will pick color.

  • Click in the area on screen where you want to pick color from. When you release the mouse button the color will be selected.

  • You can drag mouse cursor while holding mouse button. While you are dragging cursor with mouse button held down, the picker button will show you currently selected color and zoomed screen area which is currently under cursor. Note that:

    • Picked color is averaged from 9x9 px (configurable) screen area under cursor.
    • While you are holding mouse button, color is averaged (or not - configurable) between areas you passed. For example, if you press mouse button over red area on screen, then move it to yellow area, then release the button, you will actually pick some shade of orange.

Color picker button while you are moving cursor with button presed

Left area shows currently selected color, and right area shows zoomed area under cursor.

Scratchpad

Just several slots to store colors temporarly, to use them later in palette or somewhere else. "Shades" button puts first five colors from scratchpad to swatches on right, and generates shades for them according to current settings. Size of slots can be changed by dragging the edge between them. Right-click on slot to remove the color from scratchpad.

Palette toolbar

From left to right:

  • Open palette in one of supported formats. You can also drag-n-drop file to palette area to open it.
  • Download palette from Colorlovers.com.
  • Save palette in one of supported formats.
  • Toggle palette edit mode (toggled off by default).
  • Decrease/increase value (HSV) of all colors in palette.
  • Increase/decrease saturation (HSV) of all colors in palette.
  • Rotate all colors clockwise/counterclockwise.
  • Increase/decrease contrast: make light colors lighter, dark colors darker; or vice-versa.
  • Sort colors: colors in palette can be sorted by hue, saturation or value (HSV model). This operation moves colors between user-defined slots. Other slots are recalculated accordingly.

Downloading palettes from Colorlovers.com

If python-colourlovers package is installed, then downloading palettes from http://colorlovers.com by using their API is available. General view of download dialog:

Download dialog

Please note: In most cases, content of colorlovers.com is available under terms of CC BY-NC-SA 3.0 license, but there are exceptions.

In top part of dialog, you specify which palettes you want to find: new, with top rating or random (in last case you will always get 1 palette). You can also specify filter by color hue, keywords, author username. When filter is specified, press the Query button. In table in middle part of dialog you will get a list of palettes. When palette is selected in the table, a preview and short description of it is displayed at the right of the table.

To load palette, press one of buttons:

  • Load — replace current palette with selected one.
  • To scratchpad — add colors from selected palette to Scratchpad.