You are here

protected static function ScssColor::getValue in SCSS Compiler 1.0.x

Attempt to extract the value of the supplied element.

Parameters

array $element: The element for which to attempt to extract a value.

Return value

string The requested value from the supplied element.

2 calls to ScssColor::getValue()
ScssColor::processColor in src/Element/ScssColor.php
Process the element before it gets rendered in the form.
ScssColor::validateColor in src/Element/ScssColor.php
Validate this element's value on form submission.

File

src/Element/ScssColor.php, line 51

Class

ScssColor
A form element to represent null-able Sass colors.

Namespace

Drupal\compiler_scss\Element

Code

protected static function getValue(array $element) {
  $value = $element['#value'] ?? '';
  if ($value instanceof IntermediateColor) {
    $value = $value
      ->toHex();
  }
  return $value;
}