TextShadow
in package
implements
JsonSerializable
FinalYes
Shadow effect for text.
Tags
Table of Contents
Interfaces
- JsonSerializable
Properties
- $color : string|null
- The shadow color.
- $offset : TextShadowOffset|null
- The shadow offset.
- $radius : int|null
- The blur radius.
Methods
- dropShadow() : self
- Create a simple drop shadow.
- jsonSerialize() : array<string, mixed>
- {@inheritdoc}
- setColor() : $this
- Set the shadow color.
- setOffset() : $this
- Set the shadow offset.
- setOffsetXY() : $this
- Set the shadow offset using x/y values.
- setRadius() : $this
- Set the blur radius.
- subtle() : self
- Create a subtle shadow.
Properties
$color
The shadow color.
private
string|null
$color
= null
$offset
The shadow offset.
private
TextShadowOffset|null
$offset
= null
$radius
The blur radius.
private
int|null
$radius
= null
Methods
dropShadow()
Create a simple drop shadow.
public
static dropShadow([string $color = '#00000066' ][, int $radius = 2 ][, float $x = 1 ][, float $y = 1 ]) : self
Parameters
- $color : string = '#00000066'
-
The shadow color.
- $radius : int = 2
-
The blur radius.
- $x : float = 1
-
The horizontal offset.
- $y : float = 1
-
The vertical offset.
Return values
self —A new instance.
jsonSerialize()
{@inheritdoc}
public
jsonSerialize() : array<string, mixed>
Return values
array<string, mixed>setColor()
Set the shadow color.
public
setColor(string $color) : $this
Parameters
- $color : string
-
The color in hex format.
Return values
$thissetOffset()
Set the shadow offset.
public
setOffset(TextShadowOffset $offset) : $this
Parameters
- $offset : TextShadowOffset
-
The offset configuration.
Return values
$thissetOffsetXY()
Set the shadow offset using x/y values.
public
setOffsetXY(float $x, float $y) : $this
Parameters
- $x : float
-
The horizontal offset.
- $y : float
-
The vertical offset.
Return values
$thissetRadius()
Set the blur radius.
public
setRadius(int $radius) : $this
Parameters
- $radius : int
-
The radius in points.
Return values
$thissubtle()
Create a subtle shadow.
public
static subtle() : self
Return values
self —A new instance.