GradientStop
Represents a color stop in a gradient.
A gradient stop defines a color at a specific position along the gradient line.
Position is typically 0.0 (start) to 1.0 (end), but can be outside this range.
Methods
normalized
static
public static function normalized(ColorInterface $color, float $position): GradientStop
Create a new gradient stop with position clamped to the range [0, 1].
Parameters
| Name | Type | Default |
|---|---|---|
$color |
ColorInterface | - |
$position |
float | - |
public function toCss(string $colorSpace): string
Convert the gradient stop to a CSS string representation.
Parameters
| Name | Type | Default |
|---|---|---|
$colorSpace |
string | null |