The colored Reference Manual

This is the colored Reference Manual, version 1.0.0, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Sep 15 04:50:15 2024 GMT+0.

Table of Contents


1 Introduction


2 Systems

The main system appears first, followed by any subsystem dependency.


2.1 colored

System for colour representation, conversion, and operation.

Maintainer

Yukari Hafner <>

Author

Yukari Hafner <>

Home Page

https://shinmera.github.io/colored

Source Control

(GIT https://github.com/Shinmera/colored.git)

Bug Tracker

https://github.com/Shinmera/colored/issues

License

zlib

Version

1.0.0

Dependency

documentation-utils (system).

Source

colored.asd.

Child Components

3 Files

Files are sorted by type and then listed depth-first from the systems components trees.


3.1 Lisp


3.1.1 colored/colored.asd

Source

colored.asd.

Parent Component

colored (system).

ASDF Systems

colored.


3.1.2 colored/package.lisp

Source

colored.asd.

Parent Component

colored (system).

Packages

org.shirakumo.alloy.colored.


3.1.3 colored/whitepoints.lisp

Dependency

package.lisp (file).

Source

colored.asd.

Parent Component

colored (system).

Public Interface
Internals

3.1.4 colored/conversion-matrices.lisp

Dependency

whitepoints.lisp (file).

Source

colored.asd.

Parent Component

colored (system).

Public Interface
Internals

3.1.5 colored/type.lisp

Dependency

conversion-matrices.lisp (file).

Source

colored.asd.

Parent Component

colored (system).

Public Interface
Internals

3.1.6 colored/ops.lisp

Dependency

type.lisp (file).

Source

colored.asd.

Parent Component

colored (system).

Public Interface
Internals

3.1.7 colored/constants.lisp

Dependency

ops.lisp (file).

Source

colored.asd.

Parent Component

colored (system).

Public Interface

define-color (macro).


3.1.8 colored/documentation.lisp

Dependency

constants.lisp (file).

Source

colored.asd.

Parent Component

colored (system).


4 Packages

Packages are listed by definition order.


4.1 org.shirakumo.alloy.colored

Source

package.lisp.

Use List

common-lisp.

Public Interface
Internals

5 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


5.1 Public Interface


5.1.1 Macros

Macro: define-color (name int &optional channels)

Define a new color constant.

NAME should be a symbol for the constant’s name. If the symbol is not interned in any package, the name will automatically be used as a symbol designator in the ORG.SHIRAKUMO.ALLOY.COLORED.COLORS package. If the package is ORG.SHIRAKUMO.ALLOY.COLORED.COLORS, then the symbol is also automatically exported from that package.

INT should be an integer describing the full colour, as interpreted by the CONVERSION function. By default this should be an RGB integer.

Note that once the constant is defined, its value cannot be changed.

See RGB

Package

org.shirakumo.alloy.colored.

Source

constants.lisp.

Macro: define-conversion ((from to) &body matrix)

Defines a new colour space conversion matrix.

The matrix should be expressed via 9 entries that form a 3x3 matrix.

See CONVERSION-MATRIX

Package

org.shirakumo.alloy.colored.

Source

conversion-matrices.lisp.

Macro: define-whitepoint (name xy)

Defines a new whitepoint.

The whitepoint should be a list of two values, the xy chromaticity coordinates in the xyY space. They are then automatically converted and internally stored in the XYZ format.

See WHITEPOINT
See COMPUTE-D-WHITEPOINT

Package

org.shirakumo.alloy.colored.

Source

whitepoints.lisp.


5.1.2 Compiler macros

Compiler Macro: cmyk (c m y k &optional a)
Package

org.shirakumo.alloy.colored.

Source

type.lisp.

Compiler Macro: color (r g b &optional a)
Package

org.shirakumo.alloy.colored.

Source

type.lisp.

Compiler Macro: color-equal (color &rest more)
Package

org.shirakumo.alloy.colored.

Source

type.lisp.

Compiler Macro: color= (color &rest more)
Package

org.shirakumo.alloy.colored.

Source

type.lisp.

Compiler Macro: hsi (h s i &optional a)
Package

org.shirakumo.alloy.colored.

Source

type.lisp.

Compiler Macro: hsl (h s l &optional a)
Package

org.shirakumo.alloy.colored.

Source

type.lisp.

Compiler Macro: hsv (h s v &optional a)
Package

org.shirakumo.alloy.colored.

Source

type.lisp.

Compiler Macro: lab (l* a* b* &optional a)
Package

org.shirakumo.alloy.colored.

Source

type.lisp.

Compiler Macro: oklab (l* a* b* &optional a)
Package

org.shirakumo.alloy.colored.

Source

type.lisp.

Compiler Macro: rgb (r g b &optional a)
Package

org.shirakumo.alloy.colored.

Source

type.lisp.

Compiler Macro: srgb (r g b &optional a)
Package

org.shirakumo.alloy.colored.

Source

type.lisp.

Compiler Macro: xyz (x* y* z* &optional a)
Package

org.shirakumo.alloy.colored.

Source

type.lisp.


5.1.3 Ordinary functions

Reader: a (instance)

Returns the alpha channel component.

0 means transparent, 1 opaque.

See COLOR (type)

Package

org.shirakumo.alloy.colored.

Source

type.lisp.

Target Slot

a.

Reader: a* (instance)

Returns the green/red channel component.

See LAB

Package

org.shirakumo.alloy.colored.

Source

type.lisp.

Target Slot

a*.

Function: alpha (color)

Returns the alpha component of the colour.

See A

Package

org.shirakumo.alloy.colored.

Source

ops.lisp.

Reader: b (instance)

Returns the blue channel component.

See RGB
See BLUE

Package

org.shirakumo.alloy.colored.

Source

type.lisp.

Target Slot

b.

Reader: b* (instance)

Returns the blue/yellow channel component.

See LAB

Package

org.shirakumo.alloy.colored.

Source

type.lisp.

Target Slot

b*.

Function: black (color)

Returns the black component of the colour.

If not in CMYK format, is first converted to CMYK.

See K

Package

org.shirakumo.alloy.colored.

Source

ops.lisp.

Function: blue (color)

Returns the blue component of the colour.

If not in RGB format, is first converted to RGB.

See B

Package

org.shirakumo.alloy.colored.

Source

ops.lisp.

Reader: c (instance)

Returns the cyan channel component.

See CMYK
See CYAN

Package

org.shirakumo.alloy.colored.

Source

type.lisp.

Target Slot

c.

Function: cmyk (c m y k &optional a)

Create a Cyan/Magenta/Yellow/Black component colour.

See COLOR (type)
See C
See M
See Y
See K

Package

org.shirakumo.alloy.colored.

Source

type.lisp.

Function: color (r g b &optional a)
Package

org.shirakumo.alloy.colored.

Source

type.lisp.

Function: color-equal (color &rest more)

Returns true if all colours match in the RGB channels.

Unlike COLOR=, this ignores the alpha channel.

See COLOR (type)
See COLOR=

Package

org.shirakumo.alloy.colored.

Source

type.lisp.

Function: color= (color &rest more)

Returns true if all colours match in all channels.

See COLOR (type)
See COLOR-EQUAL

Package

org.shirakumo.alloy.colored.

Source

type.lisp.

Function: compute-d-whitepoint (cct)

Computes the xyY coordinates for the CIE standard illuminant series D.

CCT must be a CCT reference temperature.

See DEFINE-WHITEPOINT

Package

org.shirakumo.alloy.colored.

Source

whitepoints.lisp.

Function: conversion-matrix (from to)

Returns a linear conversion matrix for the two given colour spaces.

Signals an error if no conversion matrix to fit the from/to spaces is known. Standard conversions are known for converting to/from XYZ and the following:

:ADOBE-RGB
:APPLE-RGB
:BEST-RGB
:BETA-RGB
:BRUCE-RGB
:CIE-RGB
:COLORMATCH-RGB
:DON-RGB-4
:ECI-RGB
:EKTA-SPACE-PS5
:NTSC-RGB
:PAL-RGB
:PROPHOTO-RGB
:SMPTE-C-RGB
:SRGB
:WIDE-GAMUT-RGB

The conversion method may be passed to CONVERT via the keywords :SPACE (for a name of a colour space) or :MATRIX for passing a 9-element vector directly.

See DEFINE-CONVERSION

Package

org.shirakumo.alloy.colored.

Source

conversion-matrices.lisp.

Function: (setf conversion-matrix) (from to)
Package

org.shirakumo.alloy.colored.

Source

conversion-matrices.lisp.

Function: cyan (color)

Returns the cyan component of the colour.

If not in CMYK format, is first converted to CMYK.

See C

Package

org.shirakumo.alloy.colored.

Source

ops.lisp.

Function: decode (integer &key type channel-size channels)

Constructs a colour from the given integer colour representation.

CHANNEL-SIZE should be the number of bits per channel, and CHANNELS a list in order of the channels. The list should contain symbols naming the channels available to the requested TYPE.

For instance, to decode a 16bpc BGRA integer, you would use (decode-color int 16 ’(b g r a))

See COLOR (type)
See ENCODE

Package

org.shirakumo.alloy.colored.

Source

ops.lisp.

Function: encode (color &key channel-size channels)

Constructs an integer for the colour using the given integer colour representation.

CHANNEL-SIZE should be the number of bits per channel, and CHANNELS a
list in order of the channels. The list should contain symbols naming
channels available for the colour being encoded.

For instance, to encode a 16bpc BGRA integer, you would use
(encode-color color 16 ’(b g r a))

See COLOR (type)
See DECODE

Package

org.shirakumo.alloy.colored.

Source

ops.lisp.

Reader: g (instance)

Returns the green channel component.

See RGB
See GREEN

Package

org.shirakumo.alloy.colored.

Source

type.lisp.

Target Slot

g.

Function: gradient (x stops)

Evaluate a colour gradient at a specific point.

Returns the linear interpolation of the two colours between the stops designated by X. Each stop in STOPS should be a cons of its position along the gradient and the colour at that stop.

See LERP

Package

org.shirakumo.alloy.colored.

Source

ops.lisp.

Function: green (color)

Returns the green component of the colour.

If not in RGB format, is first converted to RGB.

See G

Package

org.shirakumo.alloy.colored.

Source

ops.lisp.

Reader: h (instance)

Returns the hue channel component.

see HSV
See HSL
See HSI
See HUE

Package

org.shirakumo.alloy.colored.

Source

type.lisp.

Target Slot

h.

Function: hsi (h s i &optional a)

Create a Hue/Saturation/Intensity component colour.

The Hue should be in [0,360[ degrees, the other two values in the [0,1] range.

See TO-HSI
See HUE
See INTENSITY
See COLOR (type)

Package

org.shirakumo.alloy.colored.

Source

type.lisp.

Function: hsl (h s l &optional a)

Create a Hue/Saturation/Lightness component colour.

The Hue should be in [0,360[ degrees, the other two values in the [0,1] range.

See TO-HSL
See HUE
See LIGHTNESS
See COLOR (type)

Package

org.shirakumo.alloy.colored.

Source

type.lisp.

Function: hsv (h s v &optional a)

Create a Hue/Saturation/Value component colour.

The Hue should be in [0,360[ degrees, the other two values in the [0,1] range.

See TO-HSV
See HUE
See SATURATION
See VALUE
See COLOR (type)

Package

org.shirakumo.alloy.colored.

Source

type.lisp.

Function: hue (color)

Returns the hue component of the colour in degrees [0,360[.

If not in HSL/HSV/HSI format, is first converted to HSV.

See H

Package

org.shirakumo.alloy.colored.

Source

ops.lisp.

Reader: i (instance)

Returns the intensity channel component.

See HSI
See INTENSITY

Package

org.shirakumo.alloy.colored.

Source

type.lisp.

Target Slot

i.

Function: intensity (color)

Returns the intensity component of the colour.

If not in HSI format, is first converted to HSI.

See I

Package

org.shirakumo.alloy.colored.

Source

ops.lisp.

Reader: k (instance)

Returns the black channel component.

See CMYK
See BLACK

Package

org.shirakumo.alloy.colored.

Source

type.lisp.

Target Slot

k.

Reader: l (instance)

Returns the lightness channel component.

See HSL
See LIGHTNESS

Package

org.shirakumo.alloy.colored.

Source

type.lisp.

Target Slot

l.

Reader: l* (instance)

Returns the lightness channel component.

See LAB

Package

org.shirakumo.alloy.colored.

Source

type.lisp.

Target Slot

l*.

Function: lab (l* a* b* &optional a)

Create a CIE LAB colour instance.

See COLOR (type)
See L*
See A*
See B*

Package

org.shirakumo.alloy.colored.

Source

type.lisp.

Function: lightness (color)

Returns the lightness component of the colour.

If not in HSL format, is first converted to HSL.

See L

Package

org.shirakumo.alloy.colored.

Source

ops.lisp.

Reader: m (instance)

Returns the magenta channel component.

See CMYK
See MAGENTA

Package

org.shirakumo.alloy.colored.

Source

type.lisp.

Target Slot

m.

Function: magenta (color)

Returns the magenta component of the colour.

If not in CMYK format, is first converted to CMYK.

See M

Package

org.shirakumo.alloy.colored.

Source

ops.lisp.

Function: oklab (l* a* b* &optional a)
Package

org.shirakumo.alloy.colored.

Source

type.lisp.

Reader: r (instance)

Returns the red channel component.

See RGB
See RED

Package

org.shirakumo.alloy.colored.

Source

type.lisp.

Target Slot

r.

Function: red (color)

Returns the red component of the colour.

If not in RGB format, is first converted to RGB.

See R

Package

org.shirakumo.alloy.colored.

Source

ops.lisp.

Function: rgb (r g b &optional a)

Create a new RGB color instance.

See COLOR (type)

Package

org.shirakumo.alloy.colored.

Source

type.lisp.

Reader: s (instance)

Returns the saturation channel component.

see HSV
See HSL
See HSI
See SATURATION

Package

org.shirakumo.alloy.colored.

Source

type.lisp.

Target Slot

s.

Function: saturation (color)

Returns the saturation component of the colour.

If not in HSL/HSV/HSI format, is first converted to HSV.

See S

Package

org.shirakumo.alloy.colored.

Source

ops.lisp.

Function: srgb (r g b &optional a)

Create a new sRGB color instance.

This is distinct from RGB by being in a non-linear space.

See COLOR (type)
See RGB

Package

org.shirakumo.alloy.colored.

Source

type.lisp.

Function: temperature-color (kelvin &optional alpha)

Compute the colour for the corresponding light temperature.

The temperature is given in Kelvin and is valid in the range [0,40’000]. Values outside this range will not yield correct colours.

Note that the range [0,1’000] is denormalised and will simply correspond to the colour for 1’000K linearly scaled down to zero.

Daylight temperatures occur in the range [5’000,6’5000], moonlight temperature is around 4’100K.

See COLOR (type)

Package

org.shirakumo.alloy.colored.

Source

ops.lisp.

Reader: v (instance)

Returns the value channel component.

See HSV
See VALUE

Package

org.shirakumo.alloy.colored.

Source

type.lisp.

Target Slot

v.

Function: value (color)

Returns the value component of the colour.

If not in HSV format, is first converted to HSV.

See V

Package

org.shirakumo.alloy.colored.

Source

ops.lisp.

Function: whitepoint (name)

Returns a reference whitepoint XYZ triplet for the requested name.

Signals an error if no whitepoint is known for the given name.
The following whitepoints are defined by default:

:A
:B
:C
:D50
:D55
:D60
:D65
:D70
:D75
:E
:F1
:F2
:F3
:F4
:F5
:F6
:F7
:F8
:F9
:F10
:F11
:F12
:LED-B1
:LED-B2
:LED-B3
:LED-B4
:LED-B5
:LED-BH1
:LED-RGB1
:LED-V1
:LED-V2

The whitepoint may be passed to CONVERT via the :WHITEPOINT keyword, as either the name of a defined whitepoint, or a vector exprsesing the XYZ triplet.

See DEFINE-WHITEPOINT

Package

org.shirakumo.alloy.colored.

Source

whitepoints.lisp.

Function: (setf whitepoint) (name)
Package

org.shirakumo.alloy.colored.

Source

whitepoints.lisp.

Reader: x* (instance)

Return the X component.

See XYZ

Package

org.shirakumo.alloy.colored.

Source

type.lisp.

Target Slot

x*.

Function: xyz (x* y* z* &optional a)

Create a CIE XYZ colour instance.

See COLOR (type)
See X*
See Y*
See Z*

Package

org.shirakumo.alloy.colored.

Source

type.lisp.

Reader: y (instance)

Returns the yellow channel component.

See CMYK
See YELLOW

Package

org.shirakumo.alloy.colored.

Source

type.lisp.

Target Slot

y.

Reader: y* (instance)

Return the Y component.

See XYZ

Package

org.shirakumo.alloy.colored.

Source

type.lisp.

Target Slot

y*.

Function: yellow (color)

Returns the yellow component of the colour.

If not in CMYK format, is first converted to CMYK.

See Y

Package

org.shirakumo.alloy.colored.

Source

ops.lisp.

Reader: z* (instance)

Return the Z component.

See XYZ

Package

org.shirakumo.alloy.colored.

Source

type.lisp.

Target Slot

z*.


5.1.4 Generic functions

Generic Function: c* (a b)
Package

org.shirakumo.alloy.colored.

Methods
Method: c* ((a rgb) (b rgb))
Source

ops.lisp.

Generic Function: c+ (a b)
Package

org.shirakumo.alloy.colored.

Methods
Method: c+ ((a rgb) (b rgb))
Source

ops.lisp.

Generic Function: c- (a b)
Package

org.shirakumo.alloy.colored.

Methods
Method: c- ((a rgb) (b rgb))
Source

ops.lisp.

Generic Function: c/ (a b)
Package

org.shirakumo.alloy.colored.

Methods
Method: c/ ((a rgb) (b rgb))
Source

ops.lisp.

Generic Function: channels (color)

Returns the list of available channels in the colour.

Accepts both a COLOR instance and a color type name.

See COLOR (type)

Package

org.shirakumo.alloy.colored.

Source

type.lisp.

Methods
Method: channels ((_ (eql org.shirakumo.alloy.colored:oklab)))
Method: channels ((_ oklab))
Method: channels ((_ (eql org.shirakumo.alloy.colored:lab)))
Method: channels ((_ lab))
Method: channels ((_ (eql org.shirakumo.alloy.colored:xyz)))
Method: channels ((_ xyz))
Method: channels ((_ (eql org.shirakumo.alloy.colored:cmyk)))
Method: channels ((_ cmyk))
Method: channels ((_ (eql org.shirakumo.alloy.colored:hsi)))
Method: channels ((_ hsi))
Method: channels ((_ (eql org.shirakumo.alloy.colored:hsl)))
Method: channels ((_ hsl))
Method: channels ((_ (eql org.shirakumo.alloy.colored:hsv)))
Method: channels ((_ hsv))
Method: channels ((_ (eql org.shirakumo.alloy.colored::hue-type)))
Method: channels ((_ hue-type))
Method: channels ((_ (eql org.shirakumo.alloy.colored:srgb)))
Method: channels ((_ srgb))
Method: channels ((_ (eql org.shirakumo.alloy.colored:rgb)))
Method: channels ((_ rgb))
Method: channels ((_ (eql org.shirakumo.alloy.colored:color)))
Method: channels ((_ color))
Generic Function: convert (color target-type &key whitepoint space matrix gamma &allow-other-keys)

Convert a colour to a different colour space (type).

Direct conversions between any colour space and any other is not guaranteed to be available, and you may have to convert to a common space such as RGB or LAB first and then to your target colour space of choice.

Certain conversions may accept additional arguments that influence the process and colour range.

See COLOR (type)

Package

org.shirakumo.alloy.colored.

Source

type.lisp.

Methods
Method: convert ((color rgb) (_ (eql org.shirakumo.alloy.colored:oklab)) &key)
Source

ops.lisp.

Method: convert ((color oklab) (_ (eql org.shirakumo.alloy.colored:rgb)) &key)
Source

ops.lisp.

Method: convert ((color rgb) (_ (eql org.shirakumo.alloy.colored:hsi)) &key)
Source

ops.lisp.

Method: convert ((color hsi) (_ (eql org.shirakumo.alloy.colored:rgb)) &key)
Source

ops.lisp.

Method: convert ((color rgb) (_ (eql org.shirakumo.alloy.colored:hsl)) &key)
Source

ops.lisp.

Method: convert ((color hsl) (_ (eql org.shirakumo.alloy.colored:rgb)) &key)
Source

ops.lisp.

Method: convert ((color rgb) (_ (eql org.shirakumo.alloy.colored:hsv)) &key)
Source

ops.lisp.

Method: convert ((color hsv) (_ (eql org.shirakumo.alloy.colored:rgb)) &key)
Source

ops.lisp.

Method: convert ((color lab) (_ (eql org.shirakumo.alloy.colored:rgb)) &rest args)
Source

ops.lisp.

Method: convert ((color rgb) (_ (eql org.shirakumo.alloy.colored:lab)) &rest args)
Source

ops.lisp.

Method: convert ((color lab) (_ (eql org.shirakumo.alloy.colored:xyz)) &key whitepoint)
Source

ops.lisp.

Method: convert ((color xyz) (_ (eql org.shirakumo.alloy.colored:lab)) &key whitepoint)
Source

ops.lisp.

Method: convert ((color xyz) (_ (eql org.shirakumo.alloy.colored:rgb)) &key space matrix)
Source

ops.lisp.

Method: convert ((color rgb) (_ (eql org.shirakumo.alloy.colored:xyz)) &key space matrix)
Source

ops.lisp.

Method: convert ((color rgb) (_ (eql org.shirakumo.alloy.colored:srgb)) &key gamma)
Source

ops.lisp.

Method: convert ((color srgb) (_ (eql org.shirakumo.alloy.colored:rgb)) &key gamma)
Source

ops.lisp.

Method: convert ((color oklab) (_ (eql org.shirakumo.alloy.colored:oklab)) &key)
Method: convert ((color lab) (_ (eql org.shirakumo.alloy.colored:lab)) &key)
Method: convert ((color xyz) (_ (eql org.shirakumo.alloy.colored:xyz)) &key)
Method: convert ((color cmyk) (_ (eql org.shirakumo.alloy.colored:cmyk)) &key)
Method: convert ((color hsi) (_ (eql org.shirakumo.alloy.colored:hsi)) &key)
Method: convert ((color hsl) (_ (eql org.shirakumo.alloy.colored:hsl)) &key)
Method: convert ((color hsv) (_ (eql org.shirakumo.alloy.colored:hsv)) &key)
Method: convert ((color hue-type) (_ (eql org.shirakumo.alloy.colored::hue-type)) &key)
Method: convert ((color srgb) (_ (eql org.shirakumo.alloy.colored:srgb)) &key)
Method: convert ((color rgb) (_ (eql org.shirakumo.alloy.colored:rgb)) &key)
Generic Function: lerp (x a b)

Linearly interpolate between two colours from the same colour space.

If the colours are of a different colour space (type), an error is signalled.

Each of the colours’ channels are interpolated separately.

Package

org.shirakumo.alloy.colored.

Methods
Method: lerp (x (a color) (b color))
Source

ops.lisp.

Method: lerp (x (a rgb) (b rgb))
Source

ops.lisp.


5.1.5 Standalone methods

Method: make-load-form ((color oklab) &optional env)
Source

type.lisp.

Method: make-load-form ((color srgb) &optional env)
Source

type.lisp.

Method: make-load-form ((color cmyk) &optional env)
Source

type.lisp.

Method: make-load-form ((color hsl) &optional env)
Source

type.lisp.

Method: make-load-form ((color hsv) &optional env)
Source

type.lisp.

Method: make-load-form ((color xyz) &optional env)
Source

type.lisp.

Method: make-load-form ((color lab) &optional env)
Source

type.lisp.

Method: make-load-form ((color hsi) &optional env)
Source

type.lisp.

Method: make-load-form ((color rgb) &optional env)
Source

type.lisp.

Method: make-load-form ((color hue-type) &optional env)
Source

type.lisp.

Method: print-object ((color oklab) stream)
Source

type.lisp.

Method: print-object ((color srgb) stream)
Source

type.lisp.

Method: print-object ((color cmyk) stream)
Source

type.lisp.

Method: print-object ((color hsl) stream)
Source

type.lisp.

Method: print-object ((color hsv) stream)
Source

type.lisp.

Method: print-object ((color xyz) stream)
Source

type.lisp.

Method: print-object ((color lab) stream)
Source

type.lisp.

Method: print-object ((color hsi) stream)
Source

type.lisp.

Method: print-object ((color rgb) stream)
Source

type.lisp.

Method: print-object ((color hue-type) stream)
Source

type.lisp.


5.1.6 Structures

Structure: cmyk
Package

org.shirakumo.alloy.colored.

Source

type.lisp.

Direct superclasses

color.

Direct methods
Direct slots
Slot: c
Type

single-float

Initform

0.0

Readers

c.

Writers

This slot is read-only.

Slot: m
Type

single-float

Initform

0.0

Readers

m.

Writers

This slot is read-only.

Slot: y
Type

single-float

Initform

0.0

Readers

y.

Writers

This slot is read-only.

Slot: k
Type

single-float

Initform

0.0

Readers

k.

Writers

This slot is read-only.

Structure: color

Representation of a colour in some space.

A colour is an immutable object and can be emitted into FASLs. Colors can and are cached aggressively thanks to their immutability.

Note that an instance returned by a constructor may or may not be EQ to a previously constructed color instance with the same channel values. To properly test equality, use COLOR= or COLOR-EQUAL.

Note that the colour channels are stored as SINGLE-FLOATs. Conversion functions to and from integers are available as operations. The floats are not constrained to be within [0,1] and can thus be used to encode high dynamic range.

See CHANNELS
See A
See COLOR (function)
See COLOR=
See COLOR-EQUAL
See RGB
See HSV
See HSL
See HSI
See CMYK
See LAB

Package

org.shirakumo.alloy.colored.

Source

type.lisp.

Direct superclasses

structure-object.

Direct subclasses
Direct methods
Direct slots
Slot: a
Type

single-float

Initform

1.0

Readers

a.

Writers

This slot is read-only.

Structure: hsi
Package

org.shirakumo.alloy.colored.

Source

type.lisp.

Direct superclasses

hue-type.

Direct methods
Direct slots
Slot: i
Type

single-float

Initform

0.0

Readers

i.

Writers

This slot is read-only.

Structure: hsl
Package

org.shirakumo.alloy.colored.

Source

type.lisp.

Direct superclasses

hue-type.

Direct methods
Direct slots
Slot: l
Type

single-float

Initform

0.0

Readers

l.

Writers

This slot is read-only.

Structure: hsv
Package

org.shirakumo.alloy.colored.

Source

type.lisp.

Direct superclasses

hue-type.

Direct methods
Direct slots
Slot: v
Type

single-float

Initform

0.0

Readers

v.

Writers

This slot is read-only.

Structure: lab
Package

org.shirakumo.alloy.colored.

Source

type.lisp.

Direct superclasses

color.

Direct subclasses

oklab.

Direct methods
Direct slots
Slot: l*
Type

single-float

Initform

0.0

Readers

l*.

Writers

This slot is read-only.

Slot: a*
Type

single-float

Initform

0.0

Readers

a*.

Writers

This slot is read-only.

Slot: b*
Type

single-float

Initform

0.0

Readers

b*.

Writers

This slot is read-only.

Structure: oklab
Package

org.shirakumo.alloy.colored.

Source

type.lisp.

Direct superclasses

lab.

Direct methods
Structure: rgb
Package

org.shirakumo.alloy.colored.

Source

type.lisp.

Direct superclasses

color.

Direct subclasses

srgb.

Direct methods
Direct slots
Slot: r
Type

single-float

Initform

0.0

Readers

r.

Writers

This slot is read-only.

Slot: g
Type

single-float

Initform

0.0

Readers

g.

Writers

This slot is read-only.

Slot: b
Type

single-float

Initform

0.0

Readers

b.

Writers

This slot is read-only.

Structure: srgb
Package

org.shirakumo.alloy.colored.

Source

type.lisp.

Direct superclasses

rgb.

Direct methods
Structure: xyz
Package

org.shirakumo.alloy.colored.

Source

type.lisp.

Direct superclasses

color.

Direct methods
Direct slots
Slot: x*
Type

single-float

Initform

0.0

Readers

x*.

Writers

This slot is read-only.

Slot: y*
Type

single-float

Initform

0.0

Readers

y*.

Writers

This slot is read-only.

Slot: z*
Type

single-float

Initform

0.0

Readers

z*.

Writers

This slot is read-only.


5.2 Internals


5.2.1 Special variables

Special Variable: *conversion-matrices*
Package

org.shirakumo.alloy.colored.

Source

conversion-matrices.lisp.

Special Variable: *whitepoints*
Package

org.shirakumo.alloy.colored.

Source

whitepoints.lisp.


5.2.2 Macros

Macro: define-channel-reader (name base-type channel &optional conversion-type)
Package

org.shirakumo.alloy.colored.

Source

ops.lisp.

Macro: define-color-type (name fields &optional super)
Package

org.shirakumo.alloy.colored.

Source

type.lisp.

Macro: define-cwise-op (name op)
Package

org.shirakumo.alloy.colored.

Source

ops.lisp.


5.2.3 Compiler macros

Compiler Macro: hue-type (h s &optional a)
Package

org.shirakumo.alloy.colored.

Source

type.lisp.


5.2.4 Ordinary functions

Function: %cmyk (c m y k a)
Package

org.shirakumo.alloy.colored.

Source

type.lisp.

Function: %hsi (h s i a)
Package

org.shirakumo.alloy.colored.

Source

type.lisp.

Function: %hsl (h s l a)
Package

org.shirakumo.alloy.colored.

Source

type.lisp.

Function: %hsv (h s v a)
Package

org.shirakumo.alloy.colored.

Source

type.lisp.

Function: %hue (color max min)
Package

org.shirakumo.alloy.colored.

Source

ops.lisp.

Function: %hue-type (h s a)
Package

org.shirakumo.alloy.colored.

Source

type.lisp.

Function: %lab (l* a* b* a)
Package

org.shirakumo.alloy.colored.

Source

type.lisp.

Function: %oklab (l* a* b* a)
Package

org.shirakumo.alloy.colored.

Source

type.lisp.

Function: %rgb (r g b a)
Package

org.shirakumo.alloy.colored.

Source

type.lisp.

Function: %srgb (r g b a)
Package

org.shirakumo.alloy.colored.

Source

type.lisp.

Function: %xyz (x* y* z* a)
Package

org.shirakumo.alloy.colored.

Source

type.lisp.

Function: _color (a)
Package

org.shirakumo.alloy.colored.

Source

type.lisp.

Function: hue-space-rgb (h c x m alpha)
Package

org.shirakumo.alloy.colored.

Source

ops.lisp.

Function: hue-type (h s &optional a)
Package

org.shirakumo.alloy.colored.

Source

type.lisp.

Function: reduce-row (matrix row a b c)
Package

org.shirakumo.alloy.colored.

Source

conversion-matrices.lisp.

Function: xy-to-xyz (x y)
Package

org.shirakumo.alloy.colored.

Source

whitepoints.lisp.


5.2.5 Generic functions

Generic Function: 2color-equal (a b)
Package

org.shirakumo.alloy.colored.

Source

type.lisp.

Methods
Method: 2color-equal ((a oklab) (b oklab))
Method: 2color-equal ((a lab) (b lab))
Method: 2color-equal ((a xyz) (b xyz))
Method: 2color-equal ((a cmyk) (b cmyk))
Method: 2color-equal ((a hsi) (b hsi))
Method: 2color-equal ((a hsl) (b hsl))
Method: 2color-equal ((a hsv) (b hsv))
Method: 2color-equal ((a hue-type) (b hue-type))
Method: 2color-equal ((a srgb) (b srgb))
Method: 2color-equal ((a rgb) (b rgb))
Generic Function: 2color= (a b)
Package

org.shirakumo.alloy.colored.

Source

type.lisp.

Methods
Method: 2color= ((a oklab) (b oklab))
Method: 2color= ((a lab) (b lab))
Method: 2color= ((a xyz) (b xyz))
Method: 2color= ((a cmyk) (b cmyk))
Method: 2color= ((a hsi) (b hsi))
Method: 2color= ((a hsl) (b hsl))
Method: 2color= ((a hsv) (b hsv))
Method: 2color= ((a hue-type) (b hue-type))
Method: 2color= ((a srgb) (b srgb))
Method: 2color= ((a rgb) (b rgb))

5.2.6 Structures

Structure: hue-type
Package

org.shirakumo.alloy.colored.

Source

type.lisp.

Direct superclasses

color.

Direct subclasses
Direct methods
Direct slots
Slot: h
Type

single-float

Initform

0.0

Readers

h.

Writers

This slot is read-only.

Slot: s
Type

single-float

Initform

0.0

Readers

s.

Writers

This slot is read-only.


Appendix A Indexes


A.1 Concepts


A.2 Functions

Jump to:   %   (   2   _  
A   B   C   D   E   F   G   H   I   K   L   M   O   P   R   S   T   V   W   X   Y   Z  
Index Entry  Section

%
%cmyk: Private ordinary functions
%hsi: Private ordinary functions
%hsl: Private ordinary functions
%hsv: Private ordinary functions
%hue: Private ordinary functions
%hue-type: Private ordinary functions
%lab: Private ordinary functions
%oklab: Private ordinary functions
%rgb: Private ordinary functions
%srgb: Private ordinary functions
%xyz: Private ordinary functions

(
(setf conversion-matrix): Public ordinary functions
(setf whitepoint): Public ordinary functions

2
2color-equal: Private generic functions
2color-equal: Private generic functions
2color-equal: Private generic functions
2color-equal: Private generic functions
2color-equal: Private generic functions
2color-equal: Private generic functions
2color-equal: Private generic functions
2color-equal: Private generic functions
2color-equal: Private generic functions
2color-equal: Private generic functions
2color-equal: Private generic functions
2color=: Private generic functions
2color=: Private generic functions
2color=: Private generic functions
2color=: Private generic functions
2color=: Private generic functions
2color=: Private generic functions
2color=: Private generic functions
2color=: Private generic functions
2color=: Private generic functions
2color=: Private generic functions
2color=: Private generic functions

_
_color: Private ordinary functions

A
a: Public ordinary functions
a*: Public ordinary functions
alpha: Public ordinary functions

B
b: Public ordinary functions
b*: Public ordinary functions
black: Public ordinary functions
blue: Public ordinary functions

C
c: Public ordinary functions
c*: Public generic functions
c*: Public generic functions
c+: Public generic functions
c+: Public generic functions
c-: Public generic functions
c-: Public generic functions
c/: Public generic functions
c/: Public generic functions
channels: Public generic functions
channels: Public generic functions
channels: Public generic functions
channels: Public generic functions
channels: Public generic functions
channels: Public generic functions
channels: Public generic functions
channels: Public generic functions
channels: Public generic functions
channels: Public generic functions
channels: Public generic functions
channels: Public generic functions
channels: Public generic functions
channels: Public generic functions
channels: Public generic functions
channels: Public generic functions
channels: Public generic functions
channels: Public generic functions
channels: Public generic functions
channels: Public generic functions
channels: Public generic functions
channels: Public generic functions
channels: Public generic functions
cmyk: Public compiler macros
cmyk: Public ordinary functions
color: Public compiler macros
color: Public ordinary functions
color-equal: Public compiler macros
color-equal: Public ordinary functions
color=: Public compiler macros
color=: Public ordinary functions
Compiler Macro, cmyk: Public compiler macros
Compiler Macro, color: Public compiler macros
Compiler Macro, color-equal: Public compiler macros
Compiler Macro, color=: Public compiler macros
Compiler Macro, hsi: Public compiler macros
Compiler Macro, hsl: Public compiler macros
Compiler Macro, hsv: Public compiler macros
Compiler Macro, hue-type: Private compiler macros
Compiler Macro, lab: Public compiler macros
Compiler Macro, oklab: Public compiler macros
Compiler Macro, rgb: Public compiler macros
Compiler Macro, srgb: Public compiler macros
Compiler Macro, xyz: Public compiler macros
compute-d-whitepoint: Public ordinary functions
conversion-matrix: Public ordinary functions
convert: Public generic functions
convert: Public generic functions
convert: Public generic functions
convert: Public generic functions
convert: Public generic functions
convert: Public generic functions
convert: Public generic functions
convert: Public generic functions
convert: Public generic functions
convert: Public generic functions
convert: Public generic functions
convert: Public generic functions
convert: Public generic functions
convert: Public generic functions
convert: Public generic functions
convert: Public generic functions
convert: Public generic functions
convert: Public generic functions
convert: Public generic functions
convert: Public generic functions
convert: Public generic functions
convert: Public generic functions
convert: Public generic functions
convert: Public generic functions
convert: Public generic functions
convert: Public generic functions
convert: Public generic functions
cyan: Public ordinary functions

D
decode: Public ordinary functions
define-channel-reader: Private macros
define-color: Public macros
define-color-type: Private macros
define-conversion: Public macros
define-cwise-op: Private macros
define-whitepoint: Public macros

E
encode: Public ordinary functions

F
Function, %cmyk: Private ordinary functions
Function, %hsi: Private ordinary functions
Function, %hsl: Private ordinary functions
Function, %hsv: Private ordinary functions
Function, %hue: Private ordinary functions
Function, %hue-type: Private ordinary functions
Function, %lab: Private ordinary functions
Function, %oklab: Private ordinary functions
Function, %rgb: Private ordinary functions
Function, %srgb: Private ordinary functions
Function, %xyz: Private ordinary functions
Function, (setf conversion-matrix): Public ordinary functions
Function, (setf whitepoint): Public ordinary functions
Function, a: Public ordinary functions
Function, a*: Public ordinary functions
Function, alpha: Public ordinary functions
Function, b: Public ordinary functions
Function, b*: Public ordinary functions
Function, black: Public ordinary functions
Function, blue: Public ordinary functions
Function, c: Public ordinary functions
Function, cmyk: Public ordinary functions
Function, color: Public ordinary functions
Function, color-equal: Public ordinary functions
Function, color=: Public ordinary functions
Function, compute-d-whitepoint: Public ordinary functions
Function, conversion-matrix: Public ordinary functions
Function, cyan: Public ordinary functions
Function, decode: Public ordinary functions
Function, encode: Public ordinary functions
Function, g: Public ordinary functions
Function, gradient: Public ordinary functions
Function, green: Public ordinary functions
Function, h: Public ordinary functions
Function, hsi: Public ordinary functions
Function, hsl: Public ordinary functions
Function, hsv: Public ordinary functions
Function, hue: Public ordinary functions
Function, hue-space-rgb: Private ordinary functions
Function, hue-type: Private ordinary functions
Function, i: Public ordinary functions
Function, intensity: Public ordinary functions
Function, k: Public ordinary functions
Function, l: Public ordinary functions
Function, l*: Public ordinary functions
Function, lab: Public ordinary functions
Function, lightness: Public ordinary functions
Function, m: Public ordinary functions
Function, magenta: Public ordinary functions
Function, oklab: Public ordinary functions
Function, r: Public ordinary functions
Function, red: Public ordinary functions
Function, reduce-row: Private ordinary functions
Function, rgb: Public ordinary functions
Function, s: Public ordinary functions
Function, saturation: Public ordinary functions
Function, srgb: Public ordinary functions
Function, temperature-color: Public ordinary functions
Function, v: Public ordinary functions
Function, value: Public ordinary functions
Function, whitepoint: Public ordinary functions
Function, x*: Public ordinary functions
Function, xy-to-xyz: Private ordinary functions
Function, xyz: Public ordinary functions
Function, y: Public ordinary functions
Function, y*: Public ordinary functions
Function, yellow: Public ordinary functions
Function, z*: Public ordinary functions
Function, _color: Private ordinary functions

G
g: Public ordinary functions
Generic Function, 2color-equal: Private generic functions
Generic Function, 2color=: Private generic functions
Generic Function, c*: Public generic functions
Generic Function, c+: Public generic functions
Generic Function, c-: Public generic functions
Generic Function, c/: Public generic functions
Generic Function, channels: Public generic functions
Generic Function, convert: Public generic functions
Generic Function, lerp: Public generic functions
gradient: Public ordinary functions
green: Public ordinary functions

H
h: Public ordinary functions
hsi: Public compiler macros
hsi: Public ordinary functions
hsl: Public compiler macros
hsl: Public ordinary functions
hsv: Public compiler macros
hsv: Public ordinary functions
hue: Public ordinary functions
hue-space-rgb: Private ordinary functions
hue-type: Private compiler macros
hue-type: Private ordinary functions

I
i: Public ordinary functions
intensity: Public ordinary functions

K
k: Public ordinary functions

L
l: Public ordinary functions
l*: Public ordinary functions
lab: Public compiler macros
lab: Public ordinary functions
lerp: Public generic functions
lerp: Public generic functions
lerp: Public generic functions
lightness: Public ordinary functions

M
m: Public ordinary functions
Macro, define-channel-reader: Private macros
Macro, define-color: Public macros
Macro, define-color-type: Private macros
Macro, define-conversion: Public macros
Macro, define-cwise-op: Private macros
Macro, define-whitepoint: Public macros
magenta: Public ordinary functions
make-load-form: Public standalone methods
make-load-form: Public standalone methods
make-load-form: Public standalone methods
make-load-form: Public standalone methods
make-load-form: Public standalone methods
make-load-form: Public standalone methods
make-load-form: Public standalone methods
make-load-form: Public standalone methods
make-load-form: Public standalone methods
make-load-form: Public standalone methods
Method, 2color-equal: Private generic functions
Method, 2color-equal: Private generic functions
Method, 2color-equal: Private generic functions
Method, 2color-equal: Private generic functions
Method, 2color-equal: Private generic functions
Method, 2color-equal: Private generic functions
Method, 2color-equal: Private generic functions
Method, 2color-equal: Private generic functions
Method, 2color-equal: Private generic functions
Method, 2color-equal: Private generic functions
Method, 2color=: Private generic functions
Method, 2color=: Private generic functions
Method, 2color=: Private generic functions
Method, 2color=: Private generic functions
Method, 2color=: Private generic functions
Method, 2color=: Private generic functions
Method, 2color=: Private generic functions
Method, 2color=: Private generic functions
Method, 2color=: Private generic functions
Method, 2color=: Private generic functions
Method, c*: Public generic functions
Method, c+: Public generic functions
Method, c-: Public generic functions
Method, c/: Public generic functions
Method, channels: Public generic functions
Method, channels: Public generic functions
Method, channels: Public generic functions
Method, channels: Public generic functions
Method, channels: Public generic functions
Method, channels: Public generic functions
Method, channels: Public generic functions
Method, channels: Public generic functions
Method, channels: Public generic functions
Method, channels: Public generic functions
Method, channels: Public generic functions
Method, channels: Public generic functions
Method, channels: Public generic functions
Method, channels: Public generic functions
Method, channels: Public generic functions
Method, channels: Public generic functions
Method, channels: Public generic functions
Method, channels: Public generic functions
Method, channels: Public generic functions
Method, channels: Public generic functions
Method, channels: Public generic functions
Method, channels: Public generic functions
Method, convert: Public generic functions
Method, convert: Public generic functions
Method, convert: Public generic functions
Method, convert: Public generic functions
Method, convert: Public generic functions
Method, convert: Public generic functions
Method, convert: Public generic functions
Method, convert: Public generic functions
Method, convert: Public generic functions
Method, convert: Public generic functions
Method, convert: Public generic functions
Method, convert: Public generic functions
Method, convert: Public generic functions
Method, convert: Public generic functions
Method, convert: Public generic functions
Method, convert: Public generic functions
Method, convert: Public generic functions
Method, convert: Public generic functions
Method, convert: Public generic functions
Method, convert: Public generic functions
Method, convert: Public generic functions
Method, convert: Public generic functions
Method, convert: Public generic functions
Method, convert: Public generic functions
Method, convert: Public generic functions
Method, convert: Public generic functions
Method, lerp: Public generic functions
Method, lerp: Public generic functions
Method, make-load-form: Public standalone methods
Method, make-load-form: Public standalone methods
Method, make-load-form: Public standalone methods
Method, make-load-form: Public standalone methods
Method, make-load-form: Public standalone methods
Method, make-load-form: Public standalone methods
Method, make-load-form: Public standalone methods
Method, make-load-form: Public standalone methods
Method, make-load-form: Public standalone methods
Method, make-load-form: Public standalone methods
Method, print-object: Public standalone methods
Method, print-object: Public standalone methods
Method, print-object: Public standalone methods
Method, print-object: Public standalone methods
Method, print-object: Public standalone methods
Method, print-object: Public standalone methods
Method, print-object: Public standalone methods
Method, print-object: Public standalone methods
Method, print-object: Public standalone methods
Method, print-object: Public standalone methods

O
oklab: Public compiler macros
oklab: Public ordinary functions

P
print-object: Public standalone methods
print-object: Public standalone methods
print-object: Public standalone methods
print-object: Public standalone methods
print-object: Public standalone methods
print-object: Public standalone methods
print-object: Public standalone methods
print-object: Public standalone methods
print-object: Public standalone methods
print-object: Public standalone methods

R
r: Public ordinary functions
red: Public ordinary functions
reduce-row: Private ordinary functions
rgb: Public compiler macros
rgb: Public ordinary functions

S
s: Public ordinary functions
saturation: Public ordinary functions
srgb: Public compiler macros
srgb: Public ordinary functions

T
temperature-color: Public ordinary functions

V
v: Public ordinary functions
value: Public ordinary functions

W
whitepoint: Public ordinary functions

X
x*: Public ordinary functions
xy-to-xyz: Private ordinary functions
xyz: Public compiler macros
xyz: Public ordinary functions

Y
y: Public ordinary functions
y*: Public ordinary functions
yellow: Public ordinary functions

Z
z*: Public ordinary functions


A.3 Variables


A.4 Data types

Jump to:   C   D   F   H   L   O   P   R   S   T   W   X  
Index Entry  Section

C
cmyk: Public structures
color: Public structures
colored: The colored system
colored.asd: The colored/colored․asd file
constants.lisp: The colored/constants․lisp file
conversion-matrices.lisp: The colored/conversion-matrices․lisp file

D
documentation.lisp: The colored/documentation․lisp file

F
File, colored.asd: The colored/colored․asd file
File, constants.lisp: The colored/constants․lisp file
File, conversion-matrices.lisp: The colored/conversion-matrices․lisp file
File, documentation.lisp: The colored/documentation․lisp file
File, ops.lisp: The colored/ops․lisp file
File, package.lisp: The colored/package․lisp file
File, type.lisp: The colored/type․lisp file
File, whitepoints.lisp: The colored/whitepoints․lisp file

H
hsi: Public structures
hsl: Public structures
hsv: Public structures
hue-type: Private structures

L
lab: Public structures

O
oklab: Public structures
ops.lisp: The colored/ops․lisp file
org.shirakumo.alloy.colored: The org․shirakumo․alloy․colored package

P
Package, org.shirakumo.alloy.colored: The org․shirakumo․alloy․colored package
package.lisp: The colored/package․lisp file

R
rgb: Public structures

S
srgb: Public structures
Structure, cmyk: Public structures
Structure, color: Public structures
Structure, hsi: Public structures
Structure, hsl: Public structures
Structure, hsv: Public structures
Structure, hue-type: Private structures
Structure, lab: Public structures
Structure, oklab: Public structures
Structure, rgb: Public structures
Structure, srgb: Public structures
Structure, xyz: Public structures
System, colored: The colored system

T
type.lisp: The colored/type․lisp file

W
whitepoints.lisp: The colored/whitepoints․lisp file

X
xyz: Public structures