Scheme
Generate color schemes based on color theory harmonies.
scheme(input: string, schemeOrOptions?: Scheme | SchemeOptions): string[]| Parameter | Description | Type | Default |
|---|---|---|---|
| format | Output format | ColorType | |
| scheme | The scheme to generate | Scheme | complementary |
type Scheme = | 'analogous' | 'complementary' | 'rectangle' | 'split' | 'split-complementary' | 'square' | 'tetradic' | 'triadic';Scheme Types
Section titled “Scheme Types”Complementary (default)
Section titled “Complementary (default)”Two colors opposite on the color wheel.
import { scheme } from 'colorizr';
scheme('#ff0044'); // ['#ff0044', '#00ffbb']Playground
Analogous
Section titled “Analogous”Three adjacent colors on the color wheel.
scheme('#ff0044', 'analogous'); // ['#ff00c3', '#ff0044', '#ff3c00']Playground
Split Complementary
Section titled “Split Complementary”Base color plus two colors adjacent to its complement.
scheme('#ff0044', 'split'); // ['#ff0044', '#00ff3c', '#00c3ff']Playground
Triadic
Section titled “Triadic”Three colors evenly spaced (120 degrees apart).
scheme('#ff0044', 'triadic'); // ['#ff0044', '#44ff00', '#0044ff']Playground
Tetradic (Rectangle)
Section titled “Tetradic (Rectangle)”Four colors forming a rectangle on the wheel.
scheme('#ff0044', 'tetradic'); // ['#ff0044', '#ffbb00', '#00ffbb', '#0044ff']Playground
Square
Section titled “Square”Four colors evenly spaced (90 degrees apart).
scheme('#ff0044', 'square'); // ['#ff0044', '#c3ff00', '#00ffbb', '#3c00ff']