(defcolor name color-def & args)Define a color by name. Automatically detects the format:
Examples: (defcolor my-red "#ff0000") (defcolor my-blue "ff0000ff") (defcolor my-green 0 255 0) (defcolor my-transparent 255 0 0 128) (defcolor faint-red (faint red 100))
Define a color by name. Automatically detects the format: - String: hex color (e.g., "#ff4488" or "ff4488dd" with alpha) - Numbers: RGB or RGBA values for p-color (e.g., 255 0 0 or 255 0 0 128) - Existing color/expression: any form that already returns a color Examples: (defcolor my-red "#ff0000") (defcolor my-blue "ff0000ff") (defcolor my-green 0 255 0) (defcolor my-transparent 255 0 0 128) (defcolor faint-red (faint red 100))
(defpalette palette-name & color-defs)Define a palette of colors. Creates individual color variables and a palette map. Color definitions can be:
Examples: (defpalette palette1 red '(255 0 0) blue "0000ff" transparent-pink [255 0 255 150] faint-red (faint red 100))
This creates:
Define a palette of colors. Creates individual color variables and a palette map.
Color definitions can be:
- String: hex color (e.g., "#ff4488" or "0000ff")
- List: RGB/RGBA values for p-color (e.g., '(255 0 0) or '(255 0 255 150))
- Vector: RGB/RGBA values for p-color (e.g., [255 0 0] or [255 0 255 150])
- Existing color/expression: any form that already returns a color
Examples:
(defpalette palette1
red '(255 0 0)
blue "0000ff"
transparent-pink [255 0 255 150]
faint-red (faint red 100))
This creates:
- Individual variables: red, blue, transparent-pink, faint-red
- A map: palette1 with {:red ... :blue ... :transparent-pink ... :faint-red ...}(set-standard-colors)Define a default palette of 32 standard colors with English names. Creates individual color vars plus a map named standard-colors.
Define a default palette of 32 standard colors with English names. Creates individual color vars plus a map named standard-colors.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |