clojure2d.color.cssgram documentation (original) (raw)

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:

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])

filters

filters-list