getRepresentation('color');
if (!$r instanceof ColorRepresentation) {
return null;
}
$children = $this->renderer->renderChildren($o);
$header = $this->renderer->renderHeader($o);
$header .= '
';
$header = $this->renderer->renderHeaderWrapper($o, (bool) \strlen($children), $header);
return ''.$header.$children.'
';
}
public function renderTab(Representation $r): ?string
{
if (!$r instanceof ColorRepresentation) {
return null;
}
$out = '';
if ($color = $r->getColor(ColorRepresentation::COLOR_NAME)) {
$out .= ''.$color."\n";
}
if ($color = $r->getColor(ColorRepresentation::COLOR_HEX_3)) {
$out .= ''.$color."\n";
}
if ($color = $r->getColor(ColorRepresentation::COLOR_HEX_6)) {
$out .= ''.$color."\n";
}
if ($r->hasAlpha()) {
if ($color = $r->getColor(ColorRepresentation::COLOR_HEX_4)) {
$out .= ''.$color."\n";
}
if ($color = $r->getColor(ColorRepresentation::COLOR_HEX_8)) {
$out .= ''.$color."\n";
}
if ($color = $r->getColor(ColorRepresentation::COLOR_RGBA)) {
$out .= ''.$color."\n";
}
if ($color = $r->getColor(ColorRepresentation::COLOR_HSLA)) {
$out .= ''.$color."\n";
}
} else {
if ($color = $r->getColor(ColorRepresentation::COLOR_RGB)) {
$out .= ''.$color."\n";
}
if ($color = $r->getColor(ColorRepresentation::COLOR_HSL)) {
$out .= ''.$color."\n";
}
}
if (!\strlen($out)) {
return null;
}
return ''.$out.'
';
}
}