Generator so previous state is never mutated.
Alpha values throughout this package use a 0–100 scale (0 = fully opaque,
100 = fully transparent). The package converts this internally to the range
PHP’s GD library expects (0–127). You do not need to perform this conversion
yourself.
color()
RGB mode: Alpha channel, 0–100 (0 = fully opaque). CMYK mode: Black
(Key) channel, 0–100. Omit for a fully opaque foreground.
backgroundColor()
color() and respects the active color model.
rgb()
cmyk()
color() and backgroundColor() interpret channel values on a 0–100 scale (percentage).
gray()
GRAY.
Background luminance on the same 0–100 scale. When
null, the background
defaults to white (100).gradient()
The gradient start color. Pass a hex string (e.g.
'#3b82f6') or an RGB array
(e.g. [59, 130, 246]).gradient() takes color values directly rather than using whatever was set by
a prior color() call. The gradient replaces the foreground color entirely.