All Manuals > CAPI User Guide and Reference Manual > 24 COLOR Reference Entries

NextPrevUpTopContentsIndex

define-color-alias

Function
Summary

Lets you define an alias for a color specification or alias.

Package

color

Signature

define-color-alias name color &optional if-exists => name

Arguments

name

The name of the new alias.

color

A color specification for the new alias.

if-exists

This can be one of the following:

:replace — Replace any existing alias.

:error — Raise an error if alias is already defined.

:ignore — Ignore redefinition of an alias.

By default, it is :replace.

Values

name

The name of the new alias.

Description

Define name to be a color alias for color , which may be another color alias or a color spec.

When color is a color spec rather than another color name, the entry is better described as a "color translation" rather than a "color alias". In particular, calling get-color-alias-translation on name will just return name . get-color-spec with name will return color .

Example 1
COLOR 16 > (define-color-alias :mygray :darkslategray)
:mygray
COLOR 17 > (define-color-alias :mygray :darkslategray
                               :error)
Error: :MYGRAY names an existing alias for #(:RGB 0.1843133S0 0.309803S0 0.309803S0)
  1 (continue) Replace :MYGRAY with the alias :DARKSLATEGRAY
  2 Continue, without redefining alias :MYGRAY
  3 Try a new name for the alias, instead of :MYGRAY
  4 (abort) Return to level 0.
  5 Return to top loop level 0.
  6 Destroy process.
Type :c followed by a number to proceed or type :? for other options COLOR 18 : 1 >
Example 2
COLOR 19 > (define-color-alias :lispworks-blue 
                (make-rgb 0.70s0 0.90s0 0.99s0))
:lispworks-blue
COLOR 20 >
See also

get-color-alias-translation
get-color-spec
The Color System


CAPI User Guide and Reference Manual (Macintosh version) - 3 Aug 2017

NextPrevUpTopContentsIndex