interface ColorInterface in Color Field 8.2
Defines a common interface for color classes.
Hierarchy
- interface \Drupal\color_field\ColorInterface
Expanded class hierarchy of ColorInterface
All classes that implement ColorInterface
File
- src/
ColorInterface.php, line 8
Namespace
Drupal\color_fieldView source
interface ColorInterface {
/**
* Get the color as a string.
*
* @return string
* The color as a string.
*/
public function toString();
/**
* Get the color as a hex instance.
*
* @return \Drupal\color_field\ColorHex
* The color as a hex instance.
*/
public function toHex();
/**
* Get the color as a RGB instance.
*
* @return \Drupal\color_field\ColorRGB
* The color as a RGB instance.
*/
public function toRgb();
/**
* Get the color as a HSL instance.
*
* @return \Drupal\color_field\ColorHSL
* The color as a HSL instance.
*/
public function toHsl();
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ColorInterface:: |
public | function | Get the color as a hex instance. | 5 |
ColorInterface:: |
public | function | Get the color as a HSL instance. | 5 |
ColorInterface:: |
public | function | Get the color as a RGB instance. | 5 |
ColorInterface:: |
public | function | Get the color as a string. | 5 |