Stop
API reference › HTML SVG › Stop
Represents the SVG <stop> element for defining gradient stop positions and colors.
Provides a concrete <stop> element implementation that returns SvgVoid::STOP and provides stop attribute
methods.
The <stop> element defines a color stop for gradients such as <linearGradient> and <radialGradient>.
See also: https://developer.mozilla.org/en-US/docs/Web/SVG/Element/stop (BaseVoid for the base implementation.).
Properties
Section titled “Properties”| Property | Type | Description | Defined by |
|---|---|---|---|
$attributes protected | mixed[] | HTML attributes array used by the implementing class. Default: []. | UIAwesome\ |
Methods
Section titled “Methods”Method details
Section titled “Method details”offset()
Section titled “offset() ”public function offset(float|int|string|null $value): staticSets the SVG offset attribute for the element.
Creates a new instance with the specified gradient stop offset value for the rendered element.
Parameters
| Parameter | Type | Description |
|---|---|---|
$value | float| | Offset value (for example, ‘0.25’, ‘50%’, or null to unset). |
Returns
static: New instance with the updated offset attribute.
Throws
InvalidArgumentException: If the value is outside the allowed range (‘0’-‘1’, or ‘0’-‘100%’) and notnull.
stopColor()
Section titled “stopColor() ”public function stopColor(string|null $value): staticSets the SVG stop-color attribute for the element.
Creates a new instance with the specified gradient stop color value for the rendered element.
Parameters
| Parameter | Type | Description |
|---|---|---|
$value | string| | Stop color value (for example, ‘#ff0000’, ‘currentColor’, or null to unset). |
Returns
static: New instance with the updated stop-color attribute.
stopOpacity()
Section titled “stopOpacity() ”public function stopOpacity(float|int|string|null $value): staticSets the SVG stop-opacity attribute for the element.
Creates a new instance with the specified gradient stop opacity value for the rendered element.
Parameters
| Parameter | Type | Description |
|---|---|---|
$value | float| | Stop opacity value (for example, ‘0.5’ or null to unset). |
Returns
static: New instance with the updated stop-opacity attribute.
Throws
InvalidArgumentException: If the value is outside the allowed range (‘0’-‘1’) and notnull.
getTag()
Section titled “getTag() ”protected function getTag(): BackedEnumReturns the tag enumeration for the <stop> element.
Returns
BackedEnum: Tag enumeration instance for <stop>. SvgVoid for valid SVG void-level tags.