1 Application
2 Autosave
3 Canvas
4 Color Model
5 Color Prefs
6 Color
7 Comment Box
8 Editor Snip
9 Editor
10 Exit
11 Finder
12 Frame
13 Group
14 GUI Utilities
15 Handler
16 Icon
17 Keymap
18 Menu
19 Mode
20 Number Snip
21 Panel
22 Pasteboard
23 Path Utils
24 Preferences
25 Preferences, Textual
26 Scheme
27 Text
28 Test
29 Version
Index
On this page:
color-model: rgb->xyz
color-model: rgb-color-distance
color-model: xyz->rgb
color-model: xyz?
color-model: xyz-x
color-model: xyz-y
color-model: xyz-z
Version: 4.0.2

 

4 Color Model

(color-model:rgb->xyz r g b)  color-model:xyz?

  r : number?

  g : number?

  b : number?

Converts a color represented as a red-green-blue tuple (each value from 0 to 255) into an XYZ tuple. This describes a point in the CIE XYZ color space.

(color-model:rgb-color-distance

 

red-a

 

 

 

 

 

 

green-a

 

 

 

 

 

 

blue-a

 

 

 

 

 

 

red-b

 

 

 

 

 

 

green-b

 

 

 

 

 

 

blue-b)

 

 

number?

  red-a : number?

  green-a : number?

  blue-a : number?

  red-b : number?

  green-b : number?

  blue-b : number?

This calculates a distance between two colors. The smaller the distance, the closer the colors should appear to the human eye. A distance of 10 is reasonably close that it could be called the same color.

This function is not symmetric in red, green, and blue, so it is important to pass red, green, and blue components of the colors in the the proper order. The first three arguments are red, green and blue for the first color, respectively, and the second three arguments are red green and blue for the second color, respectively.

(color-model:xyz->rgb x y z)  (list/c number? number? number?)

  x : number?

  y : number?

  z : number?

Converts an XYZ-tuple (in the CIE XYZ colorspace) into a list of values representing an RGB-tuple.

(color-model:xyz? val)  boolean?

  val : any/c

Determines if val an xyz color record.

(color-model:xyz-x xyz)  number?

  xyz : color-model:xyz?

Extracts the x component of xyz.

(color-model:xyz-y xyz)  number?

  xyz : color-model:xyz?

Extracts the y component of xyz.

(color-model:xyz-z xyz)  number?

  xyz : color-model:xyz?

Extracts the z component of xyz.