class ColorAlpha in Open Social 10.2.x
Same name and namespace in other branches
- 10.3.x modules/social_features/social_branding/src/Plugin/GraphQL/DataProducer/ColorAlpha.php \Drupal\social_branding\Plugin\GraphQL\DataProducer\ColorAlpha
The alpha component from color.
Plugin annotation
@DataProducer(
id = "color_alpha",
name = @Translation("Color alpha component"),
description = @Translation("The color alpha component."),
produces = @ContextDefinition("float",
label = @Translation("Color alpha component")
),
consumes = {
"color" = @ContextDefinition("any",
label = @Translation("Color"),
required = TRUE
)
}
)
Hierarchy
- class \Drupal\social_branding\Plugin\GraphQL\DataProducer\ColorAlpha extends \Drupal\social_graphql\Plugin\GraphQL\DataProducer\Entity\EntityDataProducerPluginBase
Expanded class hierarchy of ColorAlpha
File
- modules/
social_features/ social_branding/ src/ Plugin/ GraphQL/ DataProducer/ ColorAlpha.php, line 26
Namespace
Drupal\social_branding\Plugin\GraphQL\DataProducerView source
class ColorAlpha extends EntityDataProducerPluginBase {
/**
* Returns the color alpha component.
*
* @param \Drupal\social_branding\Wrappers\Color $color
* The color.
*
* @return float
* The color alpha component.
*/
public function resolve(Color $color) : float {
return $color
->alpha();
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ColorAlpha:: |
public | function | Returns the color alpha component. |