CalloutStyle
in package
FinalYes
Per-call style overrides for {@see Pdf::addCallout()} / {@see Writer\Page::drawCallout()}.
All colour fields are nullable: null means "use the CalloutType's built-in default". The two scalar fields (padding, barWidth) always have a value — there's no per-type default for those.
Table of Contents
Properties
- $barColor : array<string|int, mixed>|null
- $barWidth : float
- $bgColor : array<string|int, mixed>|null
- $labelOverride : string|null
- $padding : float
- $showLabel : bool
- $textColor : array<string|int, mixed>|null
Methods
- __construct() : mixed
- resolveBarColor() : array{float, float, float}
- resolveBgColor() : array{float, float, float}
- resolveLabel() : string
Properties
$barColor read-only
public
array<string|int, mixed>|null
$barColor
= null
$barWidth read-only
public
float
$barWidth
= 4.0
$bgColor read-only
public
array<string|int, mixed>|null
$bgColor
= null
$labelOverride read-only
public
string|null
$labelOverride
= null
$padding read-only
public
float
$padding
= 8.0
$showLabel read-only
public
bool
$showLabel
= true
$textColor read-only
public
array<string|int, mixed>|null
$textColor
= null
Methods
__construct()
public
__construct([float $padding = 8.0 ][, float $barWidth = 4.0 ][, array{float, float, float}|null $barColor = null ][, array{float, float, float}|null $bgColor = null ][, array{float, float, float}|null $textColor = null ][, bool $showLabel = true ][, string|null $labelOverride = null ]) : mixed
Parameters
- $padding : float = 8.0
-
Internal padding around the body text.
- $barWidth : float = 4.0
-
Left-edge bar thickness.
- $barColor : array{float, float, float}|null = null
-
Override the type's default bar colour.
- $bgColor : array{float, float, float}|null = null
-
Override the type's default background tint.
nullkeeps the default; pass[]-style explicit-white to disable. - $textColor : array{float, float, float}|null = null
-
Body text colour; null = theme default.
- $showLabel : bool = true
-
Whether to render the title row (e.g. "Note", "Warning").
- $labelOverride : string|null = null
-
Title text override; null = use CalloutType::defaultLabel().
resolveBarColor()
public
resolveBarColor(CalloutType $type) : array{float, float, float}
Parameters
- $type : CalloutType
Return values
array{float, float, float}resolveBgColor()
public
resolveBgColor(CalloutType $type) : array{float, float, float}
Parameters
- $type : CalloutType
Return values
array{float, float, float}resolveLabel()
public
resolveLabel(CalloutType $type) : string
Parameters
- $type : CalloutType