Same name in other branches
  1. 8.x-2.x src/ColorInterface.php \Drupal\color_field\ColorInterface

Defines a common interface for color classes.

Hierarchy

Expanded class hierarchy of ColorInterface

All classes that implement ColorInterface

Fichier

src/ColorInterface.php, line 10

Namespace

Drupal\color_field
View source
interface ColorInterface {
    
    /**
     * Get the color as a string.
     *
     * @return string
     *   The color as a string.
     */
    public function toString() : string;
    
    /**
     * Get the color as a hex instance.
     *
     * @return \Drupal\color_field\ColorHex
     *   The color as a hex instance.
     */
    public function toHex() : ColorHex;
    
    /**
     * Get the color as an RGB instance.
     *
     * @return \Drupal\color_field\ColorRGB
     *   The color as an RGB instance.
     */
    public function toRgb() : ColorRGB;
    
    /**
     * Get the color as an HSL instance.
     *
     * @return \Drupal\color_field\ColorHSL
     *   The color as an HSL instance.
     */
    public function toHsl() : ColorHSL;

}

Members

Titre Trier par ordre décroissant Modifiers Object type Résumé Overrides
ColorInterface::toHex public function Get the color as a hex instance. 4
ColorInterface::toHsl public function Get the color as an HSL instance. 4
ColorInterface::toRgb public function Get the color as an RGB instance. 4
ColorInterface::toString public function Get the color as a string. 4