The simple-rgb Reference Manual

Table of Contents

Next: , Previous: , Up: (dir)   [Contents][Index]

The simple-rgb Reference Manual

This is the simple-rgb Reference Manual, version 0.1, generated automatically by Declt version 2.3 "Robert April" on Wed Mar 14 04:35:06 2018 GMT+0.


Next: , Previous: , Up: Top   [Contents][Index]

1 Introduction

SIMPLE-RGB

This library was designed to be used by another library which generates SVG files. It is currently focused on the small set of basic color manipulations (lightening, compliments, etc) you might use to generate a color palette for a GUI or web page.

Package

The package name is :simple-rgb, with a single nickname, :rgb.

It depends on no other libraries, but you will need http://common-lisp.net/project/lift/ to run the unit tests.

Conditions and Restarts

[condition]
hsv-type-error
This condition is raised by hsv if any of the three values passed to it falls outside the range 0.0 through 1.0.

There are no restarts.

Functions

[function]
rgb r g b => rgb-vector
This is the only way to create a literal RGB value the rest of the library will accept. Each color element is an integer between 0 and 255. Anything outside this range, or of a non-integer type, will raise a type-error condition.

[function]
rgb= a b => boolean
Tests RGB equality.

[function]
hsv h s v => hsv-vector
This is the only way to create a literal HSV value the rest of the library will accept. Each of the values has to be a float between 0.0 and 1.0. A range or type problem will result in a hsv-type-error condition being raised.

Note that some HSV libraries represent the h element in degrees. This one does not.

[function]
mix-rgb a b &key (alpha 0.5) => rgb-vector
Blends two RGB colors. By default the mix is even, but by setting the :alpha keyword you can weight the mix, with 0.0 simply returning the first argument, 1.0 the second.

[function]
lighten-rgb a => rgb-vector
Lightens a color by mixing it with white with an alpha of 0.5. For different shading use mix-rgb directly.

[function]
darken-rgb a => rgb-vector
Darkens a color by mixing it with black with an alpha of 0.5. For different shading use mix-rgb directly.

[function]
greyscale-rgb a => rgb-vector
Converts a color to greyscale by setting each color element to the value 0.3r + 0.59g + 0.11b. See: http://en.wikipedia.org/wiki/Grayscale.

[function]
invert-rgb a => rgb-vector
Inverts a color.

[function]
complement-rgb a => rgb-vector
Creates the complement of the color using the forumla described at http://livedocs.adobe.com/en_US/Illustrator/13.0/help.html?content=WS714a382cdf7d304e7e07d0100196cbc5f-6288.html.

[function]
rgb->hsv a => hsv-vector
Converts an RGB value to HSV.

[function]
hsv->rgb a => rgb-vector
Converts and HSV value to RGB.

[function]
rotate-hsv a rotation => hsv-vector
Rotates the hue of a HSV color. The rotation is expressed in degrees, rather than the 0.0-1.0 range used by the rest of the library. Creating palettes of complimentary and contrasting colors is often thought of in terms of rotating a color wheel, and I've used degrees here since that's more natural for me, at least, to think about.

[function] rotate-rgb a rotation => rgb-vector
This convenience function is equivalent to:

(hsv->rgb (rotate-hsv (rgb->hsv a) rotation))

[function]
xmlify-rgb a &optional (stream nil) => x/html-color-string
Turns an RGB value into a string of the form #FFAADD. Optionally you can specify a stream designator of the sort format expects. By default it returns the string.

[function]
parse s => rgb-vector This converts an HTML color string into an RGB value.


Next: , Previous: , Up: Top   [Contents][Index]

2 Systems

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


Previous: , Up: Systems   [Contents][Index]

2.1 simple-rgb

Maintainer

William S. Annis <wm.annis@gmail.com>

Author

William S. Annis <wm.annis@gmail.com>

License

MIT

Description

simple manipulation of {X|HT}ML RGB values

Version

0.1

Source

simple-rgb.asd (file)

Components

Next: , Previous: , Up: Top   [Contents][Index]

3 Files

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


Previous: , Up: Files   [Contents][Index]

3.1 Lisp


Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.1 simple-rgb.asd

Location

simple-rgb.asd

Systems

simple-rgb (system)


Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.2 simple-rgb/package.lisp

Parent

simple-rgb (system)

Location

package.lisp

Packages

simple-rgb


Previous: , Up: Lisp files   [Contents][Index]

3.1.3 simple-rgb/rgb.lisp

Dependency

package.lisp (file)

Parent

simple-rgb (system)

Location

rgb.lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Top   [Contents][Index]

4 Packages

Packages are listed by definition order.


Previous: , Up: Packages   [Contents][Index]

4.1 simple-rgb

Source

package.lisp (file)

Nickname

rgb

Use List

common-lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Top   [Contents][Index]

5 Definitions

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


Next: , Previous: , Up: Definitions   [Contents][Index]

5.1 Exported definitions


Next: , Previous: , Up: Exported definitions   [Contents][Index]

5.1.1 Functions

Function: complement-rgb A
Package

simple-rgb

Source

rgb.lisp (file)

Function: contrast-rgb A &optional CUT
Package

simple-rgb

Source

rgb.lisp (file)

Function: darken-rgb A &key ALPHA
Package

simple-rgb

Source

rgb.lisp (file)

Function: darken-rgb! A &key ALPHA
Package

simple-rgb

Source

rgb.lisp (file)

Function: greyscale-rgb A
Package

simple-rgb

Source

rgb.lisp (file)

Function: hsv H S V
Package

simple-rgb

Source

rgb.lisp (file)

Function: hsv->rgb A
Package

simple-rgb

Source

rgb.lisp (file)

Function: invert-rgb A
Package

simple-rgb

Source

rgb.lisp (file)

Function: lighten-rgb A &key ALPHA
Package

simple-rgb

Source

rgb.lisp (file)

Function: lighten-rgb! A &key ALPHA
Package

simple-rgb

Source

rgb.lisp (file)

Function: mix-rgb A B &key ALPHA
Package

simple-rgb

Source

rgb.lisp (file)

Function: mix-rgb! A B &key ALPHA
Package

simple-rgb

Source

rgb.lisp (file)

Function: parse STRING
Package

simple-rgb

Source

rgb.lisp (file)

Function: rgb R G B
Package

simple-rgb

Source

rgb.lisp (file)

Function: rgb->hsv A
Package

simple-rgb

Source

rgb.lisp (file)

Function: rgb= A B
Package

simple-rgb

Source

rgb.lisp (file)

Function: rotate-hsv A ROTATION
Package

simple-rgb

Source

rgb.lisp (file)

Function: rotate-rgb A ROTATION
Package

simple-rgb

Source

rgb.lisp (file)

Function: xmlify-rgb A &optional STREAM
Package

simple-rgb

Source

rgb.lisp (file)


Next: , Previous: , Up: Exported definitions   [Contents][Index]

5.1.2 Conditions

Condition: hsv-type-error ()
Package

simple-rgb

Source

rgb.lisp (file)

Direct superclasses

type-error (condition)

Direct methods
Direct slots
Slot: bugged-vector
Initargs

:bugged

Readers

bugged-hsv-vector (generic function)

Writers

(setf bugged-hsv-vector) (generic function)


Previous: , Up: Exported definitions   [Contents][Index]

5.1.3 Types

Type: hsv ()
Package

simple-rgb

Source

rgb.lisp (file)

Type: rgb ()
Package

simple-rgb

Source

rgb.lisp (file)


Previous: , Up: Definitions   [Contents][Index]

5.2 Internal definitions


Next: , Previous: , Up: Internal definitions   [Contents][Index]

5.2.1 Special variables

Special Variable: +rgb-black+
Package

simple-rgb

Source

rgb.lisp (file)

Special Variable: +rgb-white+
Package

simple-rgb

Source

rgb.lisp (file)


Previous: , Up: Internal definitions   [Contents][Index]

5.2.2 Generic functions

Generic Function: bugged-hsv-vector CONDITION
Generic Function: (setf bugged-hsv-vector) NEW-VALUE CONDITION
Package

simple-rgb

Methods
Method: bugged-hsv-vector (CONDITION hsv-type-error)
Method: (setf bugged-hsv-vector) NEW-VALUE (CONDITION hsv-type-error)
Source

rgb.lisp (file)


Previous: , Up: Top   [Contents][Index]

Appendix A Indexes


Next: , Previous: , Up: Indexes   [Contents][Index]

A.1 Concepts

Jump to:   F   L   S  
Index Entry  Section

F
File, Lisp, simple-rgb.asd: The simple-rgb<dot>asd file
File, Lisp, simple-rgb/package.lisp: The simple-rgb/package<dot>lisp file
File, Lisp, simple-rgb/rgb.lisp: The simple-rgb/rgb<dot>lisp file

L
Lisp File, simple-rgb.asd: The simple-rgb<dot>asd file
Lisp File, simple-rgb/package.lisp: The simple-rgb/package<dot>lisp file
Lisp File, simple-rgb/rgb.lisp: The simple-rgb/rgb<dot>lisp file

S
simple-rgb.asd: The simple-rgb<dot>asd file
simple-rgb/package.lisp: The simple-rgb/package<dot>lisp file
simple-rgb/rgb.lisp: The simple-rgb/rgb<dot>lisp file

Jump to:   F   L   S  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.2 Functions

Jump to:   (  
B   C   D   F   G   H   I   L   M   P   R   X  
Index Entry  Section

(
(setf bugged-hsv-vector): Internal generic functions
(setf bugged-hsv-vector): Internal generic functions

B
bugged-hsv-vector: Internal generic functions
bugged-hsv-vector: Internal generic functions

C
complement-rgb: Exported functions
contrast-rgb: Exported functions

D
darken-rgb: Exported functions
darken-rgb!: Exported functions

F
Function, complement-rgb: Exported functions
Function, contrast-rgb: Exported functions
Function, darken-rgb: Exported functions
Function, darken-rgb!: Exported functions
Function, greyscale-rgb: Exported functions
Function, hsv: Exported functions
Function, hsv->rgb: Exported functions
Function, invert-rgb: Exported functions
Function, lighten-rgb: Exported functions
Function, lighten-rgb!: Exported functions
Function, mix-rgb: Exported functions
Function, mix-rgb!: Exported functions
Function, parse: Exported functions
Function, rgb: Exported functions
Function, rgb->hsv: Exported functions
Function, rgb=: Exported functions
Function, rotate-hsv: Exported functions
Function, rotate-rgb: Exported functions
Function, xmlify-rgb: Exported functions

G
Generic Function, (setf bugged-hsv-vector): Internal generic functions
Generic Function, bugged-hsv-vector: Internal generic functions
greyscale-rgb: Exported functions

H
hsv: Exported functions
hsv->rgb: Exported functions

I
invert-rgb: Exported functions

L
lighten-rgb: Exported functions
lighten-rgb!: Exported functions

M
Method, (setf bugged-hsv-vector): Internal generic functions
Method, bugged-hsv-vector: Internal generic functions
mix-rgb: Exported functions
mix-rgb!: Exported functions

P
parse: Exported functions

R
rgb: Exported functions
rgb->hsv: Exported functions
rgb=: Exported functions
rotate-hsv: Exported functions
rotate-rgb: Exported functions

X
xmlify-rgb: Exported functions

Jump to:   (  
B   C   D   F   G   H   I   L   M   P   R   X  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.3 Variables

Jump to:   +  
B   S  
Index Entry  Section

+
+rgb-black+: Internal special variables
+rgb-white+: Internal special variables

B
bugged-vector: Exported conditions

S
Slot, bugged-vector: Exported conditions
Special Variable, +rgb-black+: Internal special variables
Special Variable, +rgb-white+: Internal special variables

Jump to:   +  
B   S  

Previous: , Up: Indexes   [Contents][Index]

A.4 Data types

Jump to:   C   H   P   R   S   T  
Index Entry  Section

C
Condition, hsv-type-error: Exported conditions

H
hsv: Exported types
hsv-type-error: Exported conditions

P
Package, simple-rgb: The simple-rgb package

R
rgb: Exported types

S
simple-rgb: The simple-rgb system
simple-rgb: The simple-rgb package
System, simple-rgb: The simple-rgb system

T
Type, hsv: Exported types
Type, rgb: Exported types

Jump to:   C   H   P   R   S   T