Skip to content
This repository has been archived by the owner on Sep 18, 2023. It is now read-only.
/ palegen Public archive

An automated CSS colour palette generator

License

Notifications You must be signed in to change notification settings

adrinux/palegen

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

82 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Deprecated

The arrival of modern colour declarations in CSS (such as oklch) and the support of wider colour gamuts like P3 means the sort of automated palete generation Palegen was made for is nowmuch less useful.

Palegen

CLI based automated CSS colour palette generator. (Pronounced "pal-ee-jen".)

Palegen is a command line application that accepts a single colour, generates a harmonius palette and outputs the colours to a file as CSS variables.

screenshot of palegen html page showing output colours

Inspired by Javascript based Palx, Palegen (for the moment) lacks some of Palx's sophistication.

Palegen has one advantage in that it runs on the command line and can be part of an automated workflow (but note that output colours may shift slightly between versions).

Written in Golang Palegen uses the go-colorful library for colour conversions.

Usage

Palegen reads from a palegen.ini configuration file, see palegen.ini for a commented example. Currently you define a single input color and a destination for the output CSS. Then run palegen from the directory containing the ini file.

palegen

Output

Colours are output in hsl format as CSS variables to a file named 'colors.css'. Example CSS output from the above command and default palegen.ini is here.

By default colors.css is output to the example folder, you can view the results by opening palegen.html in a browser. An example screenshot of that page is here.

Installation

Using go get to download, compile and install will give your the very latest code:

go get github.com/adrinux/palegen

It's more sensible to check out a specific version and compile it yourself:

git clone https://github.com/adrinux/palegen.git
cd palegen
git checkout tags/0.2.0
go build

And copy the resulting binary somewhere in your path (check it's executable).

(At some point I should set up binary releases via github...)

Flaws, Issues and other things of note

  1. Colour Names: For certain input colours the names of output colours can seem a little off. Red may be perceptually orange, yellow perceptually green. See issue #4
  2. Limited to hsl() CSS output. See #8