You are here

public function ColorItemInterface::getColor in Color API 8

Retrieve the color array for the Color Field item.

Return value

array An array containing the following keys:

  • hexadecimal: The hexadecimal string representation of the color.
  • rgb: An array containing the following values:
    • 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.
1 method overrides ColorItemInterface::getColor()
ColorItem::getColor in src/Plugin/Field/FieldType/ColorItem.php
Retrieve the color array for the Color Field item.

File

src/Plugin/Field/FieldType/ColorItemInterface.php, line 63

Class

ColorItemInterface
Interface for Field API Color items.

Namespace

Drupal\colorapi\Plugin\Field\FieldType

Code

public function getColor();