Automattic\WooCommerce\EmailEditorVendor\Sabberworm\CSS\Value

Color::render │ public │ WC 1.0

Метод класса: Color{}

Хуков нет.

Возвращает

string.

Использование

$Color = new Color();
$Color->render( $oOutputFormat );
$oOutputFormat(OutputFormat|null) (обязательный)
.

Код Color::render() WC 11.3.0

public function render($oOutputFormat)
{
    // Shorthand RGB color values
    if ($oOutputFormat->getRGBHashNotation() && implode('', array_keys($this->aComponents)) === 'rgb') {
        $sResult = sprintf(
            '%02x%02x%02x',
            $this->aComponents['r']->getSize(),
            $this->aComponents['g']->getSize(),
            $this->aComponents['b']->getSize()
        );
        return '#' . (($sResult[0] == $sResult[1]) && ($sResult[2] == $sResult[3]) && ($sResult[4] == $sResult[5])
                ? "$sResult[0]$sResult[2]$sResult[4]" : $sResult);
    }
    return parent::render($oOutputFormat);
}