You are here

public function ColorData::setHexadecimal in Color API 8

Set the 'hexadecimal' property of the Color Data.

Parameters

string $color: The hexadecimal string value representing the color.

bool $notify: Whether to notify the parent object of the change. Defaults to TRUE. If a property is updated from a parent object, set it to FALSE to avoid being notified again.

Overrides ColorInterface::setHexadecimal

1 call to ColorData::setHexadecimal()
ColorData::setValue in src/Plugin/DataType/ColorData.php
Overrides \Drupal\Core\TypedData\TypedData::setValue().

File

src/Plugin/DataType/ColorData.php, line 45

Class

ColorData
Provides the Color Typed Data type.

Namespace

Drupal\colorapi\Plugin\DataType

Code

public function setHexadecimal($color, $notify = TRUE) {
  $this
    ->get('hexadecimal')
    ->setValue($color, $notify);
}