ColorPaletteBuilder
Fluent builder for creating and manipulating color palettes.
Methods
public function add(ColorInterface|string $color, string|int|null $name): ColorPaletteBuilder
Add a color to the palette.
Parameters
| Name | Type | Default |
|---|---|---|
$color |
ColorInterface|string | - |
$name |
string|int|null | null |
public function addAll(iterable $colors): ColorPaletteBuilder
Add multiple colors to the palette.
Parameters
| Name | Type | Default |
|---|---|---|
$colors |
iterable | - |
public function fix(PaletteFixerInterface $fixer, array $options): ColorPaletteBuilder
Apply a fixer to the current colors in the builder.
Parameters
| Name | Type | Default |
|---|---|---|
$fixer |
PaletteFixerInterface | - |
$options |
array | [] |
public function harmony(ColorInterface|string $base, HarmonyPattern|string $pattern): ColorPaletteBuilder
Add a harmony palette generated from a base color.
Parameters
| Name | Type | Default |
|---|---|---|
$base |
ColorInterface|string | - |
$pattern |
HarmonyPattern|string | - |
public function shades(ColorInterface|string $color, int $steps): ColorPaletteBuilder
Add a scale of shades generated from a base color.
Parameters
| Name | Type | Default |
|---|---|---|
$color |
ColorInterface|string | - |
$steps |
int | 5 |
public function tints(ColorInterface|string $color, int $steps): ColorPaletteBuilder
Add a scale of tints generated from a base color.
Parameters
| Name | Type | Default |
|---|---|---|
$color |
ColorInterface|string | - |
$steps |
int | 5 |
public function transform(ColorPaletteTransformerInterface|callable $transformer): ColorPaletteBuilder
Apply a transformer to the current colors in the builder.
Parameters
| Name | Type | Default |
|---|---|---|
$transformer |
ColorPaletteTransformerInterface|callable | - |