You are here

public function ColorData::getRgb in Color API 8

Retrieve RGB value array of the Color data ojbect..

Return value

array An array containing the following keys:

  • red: The value for the RGB "red". An integer between 0 and 255.
  • green: The value for the RGB "green". An integer between 0 and 255.
  • blue: The value for the RGB "blue". An integer between 0 and 255.

Overrides ColorInterface::getRgb

File

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

Class

ColorData
Provides the Color Typed Data type.

Namespace

Drupal\colorapi\Plugin\DataType

Code

public function getRgb() {
  return $this
    ->get('rgb')
    ->getValue();
}