Liking cljdoc? Tell your friends :D

clojure2d.color.cssgram

Reimplementation of selection of instagram color filters.

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

Reimplementation of selection of instagram color filters.

* Webpage: https://una.im/CSSgram/
* Info: https://alistapart.com/article/finessing-fecolormatrix/
* Source: https://github.com/una/CSSgram
* Licence: MIT

Additionally there is an possibility to create custom color filter with [[custom-filter]].
raw docstring

adenclj

(aden c)
source

brooklynclj

(brooklyn c)
source

clarendonclj

(clarendon c)
source

custom-filterclj

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

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](https://developer.mozilla.org/en-US/docs/Web/SVG/Element/feColorMatrix)
    - `: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](https://www.w3.org/TR/compositing-1/#blending).

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])`
sourceraw docstring

earlybirdclj

(earlybird c)
source

filtersclj

source

filters-listclj

source

ginghamclj

(gingham c)
source

hudsonclj

(hudson c)
source

inkwellclj

(inkwell c)
source

kelvinclj

(kelvin c)
source

larkclj

(lark c)
source

loficlj

(lofi c)
source

mavenclj

(maven c)
source

mayfairclj

(mayfair c)
source

moonclj

(moon c)
source

nashvilleclj

(nashville c)
source

reyesclj

(reyes c)
source

riseclj

(rise c)
source

slumberclj

(slumber c)
source

stinsonclj

(stinson c)
source

toasterclj

(toaster c)
source

valenciaclj

(valencia c)
source

waldenclj

(walden c)
source

willowclj

(willow c)
source

x-pro2clj

(x-pro2 c)
source

y1977clj

(y1977 c)
source

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close