A library for dealing with colours and colour spaces https://shinmera.com/docs/colored
  • Common Lisp 100%
Find a file
2025-08-20 15:49:41 +02:00
docs Doc update 2025-08-20 15:49:41 +02:00
colored-test.asd Update linkage 2025-08-11 21:19:36 +02:00
colored.asd Update linkage 2025-08-11 21:19:36 +02:00
constants.lisp Add list-colors 2023-10-25 13:40:00 +02:00
conversion-matrices.lisp Update copyright 2023-07-03 19:01:30 +02:00
documentation.lisp Luminance 2025-05-02 09:05:11 +02:00
LICENSE Update copyright 2023-07-03 19:01:30 +02:00
ops.lisp Luminance 2025-05-02 09:05:11 +02:00
package.lisp Luminance 2025-05-02 09:05:11 +02:00
README.mess Docs. 2020-07-09 18:00:10 +02:00
staple.ext.lisp Docgen 2020-07-09 18:16:11 +02:00
test.lisp Update copyright 2023-07-03 19:01:30 +02:00
type.lisp Fungle with compile time order for CCL to eat the source. 2024-12-04 08:24:06 +01:00
whitepoints.lisp Update copyright 2023-07-03 19:01:30 +02:00

## About Colored
This is a library for representing and mapping colours between their various spaces.

It currently does not support ICC colour space conversions from colour profile files. This is however planned for a future release. If there are other mappings missing that you need, please file an issue.

## How To
For the purposes of this tutorial we assume the package ``org.shirakumo.alloy.colored`` is nicknamed ``colored``.

Primarily, colours are constructed using ``color`` or one of the specific colour space constructors (``rgb``, ``srgb``, ``hsv``, ``hsl``, ``hsi``, ``cmyk``, ``lab``, ``xyz``).

You can also de/serialise colours from direct integer format using the ``encode`` and ``decode`` functions.

Colours are immutable. As such they can and will be cached wherever possible. Nevertheless, it is not guaranteed that two colours with the same channel values will be ``eq``. To compare colours, use ``color=`` and ``color-equal``.

::common lisp
(colored:color= (colored:color 1 0 0) (colored:decode #xFF0000)) ; => T
::

In order to convert colours between different colour spaces, use the ``convert`` function.

## Constants
Colored offers a database of standard colours with their associated colour values. You can find these in the ``org.shirakumo.alloy.colored.colors`` package. You can also define new colours using ``define-color``.