We use cookies to make our website more effective. By using our website you agree to our privacy policy.

Namespace: colors

colors

colors.js is part of Aloha Editor project http://www.alohaeditor.org

Aloha Editor ● JavaScript Content Editing Library
Copyright (c) 2010-2015 Gentics Software GmbH, Vienna, Austria.
Contributors http://www.alohaeditor.org/docs/contributing.html

Methods

cross(from, to, percent){Array.<number>}

Cross fades RGBA color `from` to RBG color `to` by a given percent.
Name Type Description
from Array.<number>
to Array.<number>
percent number Range from 0 - 1

equals(a, b){boolean}

Checks whether the two given colors are equal in value (if not in
representation).

equals('#f00', 'rgb(255,0,0)') == true
Name Type Description
a string
b string

hex(value){string}

Given a color string, will normalize it to a hexidecimal color string.
Name Type Description
value string

rgb(value){Array.<number>}

Given a color string, will normalize it to a RGB color string.
Name Type Description
value string

serialize(color){string}

Returns a human readable representation of the given color.
Name Type Description
color Array.<(number|string)>
comments powered by Disqus