namespace Kint\Renderer\Rich;
use Kint\Zval\Representation\ColorRepresentation;
use Kint\Zval\Representation\Representation;
use Kint\Zval\Value;
class ColorPlugin extends AbstractPlugin
implements TabPluginInterface, ValuePluginInterface
{ public function renderValue(Value
$o): ?string
{ $r =
$o->
getRepresentation('color'
);
if (!
$r instanceof ColorRepresentation
) { return null;
} $children =
$this->renderer->
renderChildren($o);
$header =
$this->renderer->
renderHeader($o);
$header .= '<div class="kint-color-preview"><div style="background:';
$header .=
$r->
getColor(ColorRepresentation::COLOR_RGBA
);
$header .= '"></div></div>';