You are here

interface ColorInterface in Color Field 8.2

Defines a common interface for color classes.

Hierarchy

Expanded class hierarchy of ColorInterface

All classes that implement ColorInterface

File

src/ColorInterface.php, line 8

Namespace

Drupal\color_field
View 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

Namesort descending Modifiers Type Description Overrides
ColorInterface::toHex public function Get the color as a hex instance. 5
ColorInterface::toHsl public function Get the color as a HSL instance. 5
ColorInterface::toRgb public function Get the color as a RGB instance. 5
ColorInterface::toString public function Get the color as a string. 5