interface ColorInterface in Color API 8
Same name in this branch
- 8 src/Entity/ColorInterface.php \Drupal\colorapi\Entity\ColorInterface
- 8 src/Plugin/DataType/ColorInterface.php \Drupal\colorapi\Plugin\DataType\ColorInterface
Interface for the Typed Data Color Complex Data type.
Hierarchy
- interface \Drupal\Core\TypedData\TypedDataInterface
- interface \Drupal\Core\TypedData\TraversableTypedDataInterface extends \Drupal\Core\TypedData\Traversable
- interface \Drupal\Core\TypedData\ComplexDataInterface
- interface \Drupal\colorapi\Plugin\DataType\ColorInterface
- interface \Drupal\Core\TypedData\ComplexDataInterface
- interface \Drupal\Core\TypedData\TraversableTypedDataInterface extends \Drupal\Core\TypedData\Traversable
Expanded class hierarchy of ColorInterface
All classes that implement ColorInterface
File
- src/
Plugin/ DataType/ ColorInterface.php, line 10
Namespace
Drupal\colorapi\Plugin\DataTypeView source
interface ColorInterface extends ComplexDataInterface {
/**
* Set the 'hexadecimal' property of the Color Data.
*
* @param string $color
* The hexadecimal string value representing the color.
* @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 setHexadecimal($color, $notify = TRUE);
/**
* Retrieve the hexadecimal color string representation of the color.
*
* @return string
* The hexadecimal string representation of the color.
*/
public function getHexadecimal();
/**
* Set the 'rgb' property of the Color Data.
*
* @param array $rgb
* An array containing the following values:
* - red: The value for the RGB "red". An integer between 0 and 255.
* - green: The value for the RGB "green". An integer between 0 and
* 255.
* - blue: The value for the RGB "blue". 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 setRgb(array $rgb, $notify = TRUE);
/**
* Retrieve RGB value array of the Color data ojbect..
*
* @return array
* An array containing the following keys:
* - red: The value for the RGB "red". An integer between 0 and 255.
* - green: The value for the RGB "green". An integer between 0 and
* 255.
* - blue: The value for the RGB "blue". An integer between 0 and 255.
*/
public function getRgb();
/**
* Set 'red' property of the Color Data's 'RGB' property.
*
* @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 Color data object RGB property.
*
* @return array
* The value for the RGB "red". An integer between 0 and 255.
*/
public function getRed();
/**
* Set 'green' property of the Color Data's 'RGB' property.
*
* @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 Color data object RGB property.
*
* @return array
* The value for the RGB "green". An integer between 0 and 255.
*/
public function getGreen();
/**
* Set 'blue' property of the Color Data's 'RGB' property.
*
* @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 Color data object RGB property.
*
* @return array
* The value for the RGB "red". An integer between 0 and 255.
*/
public function getBlue();
}
Members
Name![]() |
Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ColorInterface:: |
public | function | Retrieve 'Blue' value of the Color data object RGB property. | |
ColorInterface:: |
public | function | Retrieve 'Green' value of the Color data object RGB property. | |
ColorInterface:: |
public | function | Retrieve the hexadecimal color string representation of the color. | |
ColorInterface:: |
public | function | Retrieve 'Red' value of the Color data object RGB property. | |
ColorInterface:: |
public | function | Retrieve RGB value array of the Color data ojbect.. | |
ColorInterface:: |
public | function | Set 'blue' property of the Color Data's 'RGB' property. | 1 |
ColorInterface:: |
public | function | Set 'green' property of the Color Data's 'RGB' property. | 1 |
ColorInterface:: |
public | function | Set the 'hexadecimal' property of the Color Data. | 1 |
ColorInterface:: |
public | function | Set 'red' property of the Color Data's 'RGB' property. | 1 |
ColorInterface:: |
public | function | Set the 'rgb' property of the Color Data. | 1 |
ComplexDataInterface:: |
public | function | Gets a property object. | 2 |
ComplexDataInterface:: |
public | function |
Gets the data definition. Overrides TypedDataInterface:: |
|
ComplexDataInterface:: |
public | function | Gets an array of property objects. | 3 |
ComplexDataInterface:: |
public | function | Determines whether the data structure is empty. | 2 |
ComplexDataInterface:: |
public | function | Sets a property value. | 3 |
ComplexDataInterface:: |
public | function | Returns an array of all property values. | 2 |
TraversableTypedDataInterface:: |
public | function | React to changes to a child property or item. | 4 |
TypedDataInterface:: |
public | function | Applies the default value. | 1 |
TypedDataInterface:: |
public static | function | Constructs a TypedData object given its definition and context. | 1 |
TypedDataInterface:: |
public | function | Gets a list of validation constraints. | 1 |
TypedDataInterface:: |
public | function | Returns the name of a property or item. | 1 |
TypedDataInterface:: |
public | function | Returns the parent data structure; i.e. either complex data or a list. | 1 |
TypedDataInterface:: |
public | function | Returns the property path of the data. | 1 |
TypedDataInterface:: |
public | function | Returns the root of the typed data tree. | 1 |
TypedDataInterface:: |
public | function | Returns a string representation of the data. | 1 |
TypedDataInterface:: |
public | function | Gets the data value. | 1 |
TypedDataInterface:: |
public | function | Sets the context of a property or item via a context aware parent. | 1 |
TypedDataInterface:: |
public | function | Sets the data value. | 1 |
TypedDataInterface:: |
public | function | Validates the currently set data value. | 1 |