You are here

public function ColorapiServiceInterface::hexToRgb in Color API 8

Helper function to convert hex to rgb.

Parameters

string $hex: The color in hexadecimal string format.

string $colorIndex: The color value to return, must be one of:

  • red
  • green
  • blue.
1 method overrides ColorapiServiceInterface::hexToRgb()
ColorapiService::hexToRgb in src/Service/ColorapiService.php
Helper function to convert hex to rgb.

File

src/Service/ColorapiServiceInterface.php, line 21

Class

ColorapiServiceInterface
Interface for the Colorapi Service class.

Namespace

Drupal\colorapi\Service

Code

public function hexToRgb($hex, $colorIndex);