Apple News API PHP Client

ComponentShadow
in package
implements JsonSerializable

FinalYes

Shadow effect for components.

Tags
see
https://developer.apple.com/documentation/apple_news/componentshadow

Table of Contents

Interfaces

JsonSerializable

Properties

$color  : string|null
The shadow color.
$offsetX  : int|null
The horizontal offset.
$offsetY  : int|null
The vertical offset.
$opacity  : float|null
The shadow opacity (0.0 to 1.0).
$radius  : int|null
The blur radius.

Methods

jsonSerialize()  : array<string, mixed>
{@inheritdoc}
medium()  : self
Create a medium shadow.
setColor()  : $this
Set the shadow color.
setOffset()  : $this
Set the offset.
setOpacity()  : $this
Set the opacity.
setRadius()  : $this
Set the blur radius.
strong()  : self
Create a strong shadow.
subtle()  : self
Create a subtle shadow.

Properties

$opacity

The shadow opacity (0.0 to 1.0).

private float|null $opacity = null

Methods

jsonSerialize()

{@inheritdoc}

public jsonSerialize() : array<string, mixed>
Return values
array<string, mixed>

medium()

Create a medium shadow.

public static medium() : self
Return values
self —

A new instance.

setColor()

Set the shadow color.

public setColor(string $color) : $this
Parameters
$color : string

The color in hex format.

Return values
$this

setOffset()

Set the offset.

public setOffset(int $x, int $y) : $this
Parameters
$x : int

The horizontal offset in points.

$y : int

The vertical offset in points.

Return values
$this

setOpacity()

Set the opacity.

public setOpacity(float $opacity) : $this
Parameters
$opacity : float

Opacity from 0.0 to 1.0.

Return values
$this

setRadius()

Set the blur radius.

public setRadius(int $radius) : $this
Parameters
$radius : int

The radius in points.

Return values
$this

strong()

Create a strong shadow.

public static strong() : self
Return values
self —

A new instance.

subtle()

Create a subtle shadow.

public static subtle() : self
Return values
self —

A new instance.


        
On this page

Search results