A98 RGB

Adobe RGB 1998: the print-oriented wide gamut.

Channels
  • R Red 0 to 1
  • G Green 0 to 1
  • B Blue 0 to 1
CSS syntax
color(a98-rgb ...)
White point
D65
Category
RGB
PHP class
A98RgbColor
Reach for it when
Photography and prepress interchange.

Convert to A98 RGB in PHP

Any color converts with to(); the result is A98 RGB, an object with its own channels.

<?php

$color = Color::parse('#3b82f6')->to('a98-rgb');

$color->getChannels();
// ['r' => 0.3427, 'g' => 0.5057, 'b' => 0.9498]
$color = Color::parse('#3b82f6')->to('a98-rgb'); $color->getChannels(); // ['r' => 0.3427, 'g' => 0.5057, 'b' => 0.9498]

Parse A98 RGB in PHP

The regular CSS syntax goes straight into Color::parse().

<?php

$color = Color::parse('color(a98-rgb 0.28 0.5 0.95)');

$color->toHex(); // #0081f6
$color = Color::parse('color(a98-rgb 0.28 0.5 0.95)'); $color->toHex(); // #0081f6

Export A98 RGB in CSS

Every color object serializes back to the CSS form of its space.

<?php

Color::parse('#3b82f6')->to('a98-rgb')->toCss();
// color(a98-rgb 0.342669 0.505675 0.949761)
Color::parse('#3b82f6')->to('a98-rgb')->toCss(); // color(a98-rgb 0.342669 0.505675 0.949761)

Validate A98 RGB

tryFrom() returns null on invalid input instead of throwing.

<?php

Color::tryFrom('color(a98-rgb 0.28 0.5 0.95)'); // instance

Color::tryFrom('color(nope)'); // null
Color::tryFrom('color(a98-rgb 0.28 0.5 0.95)'); // instance Color::tryFrom('color(nope)'); // null