You are here

interface RgbColorInterface in Color API 8

Interface for the Typed Data RGB Color Complex Data type.

Hierarchy

Expanded class hierarchy of RgbColorInterface

All classes that implement RgbColorInterface

File

src/Plugin/DataType/RgbColorInterface.php, line 10

Namespace

Drupal\colorapi\Plugin\DataType
View source
interface RgbColorInterface extends ComplexDataInterface {

  /**
   * Set 'red' property of the RGB object.
   *
   * @param string $red
   *   The value for the RGB "red" property. An integer between 0 and 255.
   * @param bool $notify
   *   Whether to notify the parent object of the change. Defaults to TRUE. If a
   *   property is updated from a parent object, set it to FALSE to avoid being
   *   notified again.
   */
  public function setRed($red, $notify = TRUE);

  /**
   * Retrieve 'Red' value of the RGB data object.
   *
   * @return array
   *   The value for "red" value. An integer between 0 and 255.
   */
  public function getRed();

  /**
   * Set 'green' property of the RGB object.
   *
   * @param string $green
   *   The value for the RGB "green" property. An integer between 0 and 255.
   * @param bool $notify
   *   Whether to notify the parent object of the change. Defaults to TRUE. If a
   *   property is updated from a parent object, set it to FALSE to avoid being
   *   notified again.
   */
  public function setGreen($green, $notify = TRUE);

  /**
   * Retrieve 'Green' value of the RGB data object.
   *
   * @return array
   *   The value for "green" value. An integer between 0 and 255.
   */
  public function getGreen();

  /**
   * Set 'blue' property of the RGB object.
   *
   * @param string $blue
   *   The value for the RGB "blue" property. An integer between 0 and 255.
   * @param bool $notify
   *   Whether to notify the parent object of the change. Defaults to TRUE. If a
   *   property is updated from a parent object, set it to FALSE to avoid being
   *   notified again.
   */
  public function setBlue($blue, $notify = TRUE);

  /**
   * Retrieve 'blue' value of the RGB data object.
   *
   * @return array
   *   The value for "blue" value. An integer between 0 and 255.
   */
  public function getBlue();

}

Members

Namesort descending Modifiers Type Description Overrides
ComplexDataInterface::get public function Gets a property object. 2
ComplexDataInterface::getDataDefinition public function Gets the data definition. Overrides TypedDataInterface::getDataDefinition
ComplexDataInterface::getProperties public function Gets an array of property objects. 3
ComplexDataInterface::isEmpty public function Determines whether the data structure is empty. 2
ComplexDataInterface::set public function Sets a property value. 3
ComplexDataInterface::toArray public function Returns an array of all property values. 2
RgbColorInterface::getBlue public function Retrieve 'blue' value of the RGB data object. 1
RgbColorInterface::getGreen public function Retrieve 'Green' value of the RGB data object. 1
RgbColorInterface::getRed public function Retrieve 'Red' value of the RGB data object. 1
RgbColorInterface::setBlue public function Set 'blue' property of the RGB object. 1
RgbColorInterface::setGreen public function Set 'green' property of the RGB object. 1
RgbColorInterface::setRed public function Set 'red' property of the RGB object. 1
TraversableTypedDataInterface::onChange public function React to changes to a child property or item. 4
TypedDataInterface::applyDefaultValue public function Applies the default value. 1
TypedDataInterface::createInstance public static function Constructs a TypedData object given its definition and context. 1
TypedDataInterface::getConstraints public function Gets a list of validation constraints. 1
TypedDataInterface::getName public function Returns the name of a property or item. 1
TypedDataInterface::getParent public function Returns the parent data structure; i.e. either complex data or a list. 1
TypedDataInterface::getPropertyPath public function Returns the property path of the data. 1
TypedDataInterface::getRoot public function Returns the root of the typed data tree. 1
TypedDataInterface::getString public function Returns a string representation of the data. 1
TypedDataInterface::getValue public function Gets the data value. 1
TypedDataInterface::setContext public function Sets the context of a property or item via a context aware parent. 1
TypedDataInterface::setValue public function Sets the data value. 1
TypedDataInterface::validate public function Validates the currently set data value. 1