clojure2d.color.cssgram

Reimplementation of selection of instagram color filters.

Additionally there is an possibility to create custom color filter with custom-filter.

aden

(aden c)

brooklyn

(brooklyn c)

clarendon

(clarendon c)

custom-filter

(custom-filter & defs)

Create a custom filter out of list of step definitions. A filter is a function wich returns new color for a given one.

Each step can be one of:

  • a function which takes color and returs new color
  • a vector with an operator name as a keyword and arguments
    • one of the: :sepia, :contrast, :exposure, :brightness, :grayscale, :hue-rotate, :saturation, :tint - with an amount as the argument (see below)
    • :temperature with temperature in Kelvins and amount (0.0-1.0)
    • :matrix - feColorMatrix definition, see here
    • :blend for blending two colors, parameters are blednding operator and a color (see below)

Bleding operators are defined in clojure2d.color.blend/blends-list plus :hue, :saturation, :luminocity and :color which copies one/two channels between colors in HSB color space. see here.

Note: CSS brightness is defined as :exposure which multiplies channels by given amount. :brightness changes channels by adding a percentage of the original value.

Example: to construct moon filter, our definition will look like below:

(custom-filter [:blend :softlight (c/gray 0xa0)] [:blend :lighten (c/gray 0x38)] [:grayscale 1.0] [:contrast 1.1] [:exposure 1.1])

earlybird

(earlybird c)

filters

filters-list

gingham

(gingham c)

hudson

(hudson c)

inkwell

(inkwell c)

kelvin

(kelvin c)

lark

(lark c)

lofi

(lofi c)

maven

(maven c)

mayfair

(mayfair c)

moon

(moon c)

nashville

(nashville c)

reyes

(reyes c)

rise

(rise c)

slumber

(slumber c)

stinson

(stinson c)

toaster

(toaster c)

valencia

(valencia c)

walden

(walden c)

willow

(willow c)

x-pro2

(x-pro2 c)

y1977

(y1977 c)