Next: , Previous: , Up: API  


1.6 (hygguile components color)

1.6.1 Procedures

Procedure: color-swatch KEY: #:color #:label #:aria-label #:swatch-classes #:label-classes

Create a clickable colour tile that steps through the shades of a palette colour.

The tile carries bg-<color> and shows that colour’s name; the script it calls replaces the class with the next variant of the same colour every time it is clicked – 100, 300, 500, 700, 900 and back to 100 – and relabels the tile to match, so the tile always names the shade it is showing.

color

The palette colour to show, named the way a class names it: apple-green-500.

label

The text on the tile, or #f for the colour’s own name.

aria-label

The accessible name of the tile, or #f for a sentence naming the colour and what a click does.

swatch-classes

List of CSS classes for the tile itself.

label-classes

List of CSS classes for the frosted caption inside it.

(color-swatch #:color 'apple-green-500)