AbstractGradient
AbstractAbstract base class for gradient implementations.
Provides common functionality for color interpolation and stop management.
Methods
public function addStop(ColorInterface $color, float $position): static
Add a color stop to the gradient.
Parameters
| Name | Type | Default |
|---|---|---|
$color |
ColorInterface | - |
$position |
float | - |
public function getStops(): array
public function interpolate(float $position): ColorInterface
Parameters
| Name | Type | Default |
|---|---|---|
$position |
float | - |
public function toCss(string $colorSpace): string
Generate CSS gradient notation.
Parameters
| Name | Type | Default |
|---|---|---|
$colorSpace |
string | null |