You are here

class ColorCSS in Open Social 10.2.x

Same name and namespace in other branches
  1. 10.3.x modules/social_features/social_branding/src/Plugin/GraphQL/DataProducer/ColorCSS.php \Drupal\social_branding\Plugin\GraphQL\DataProducer\ColorCSS

The CSS color.

Plugin annotation


@DataProducer(
  id = "color_css",
  name = @Translation("CSS Color"),
  description = @Translation("A color value that is valid for the CSS 'color' property. Any CSS spec compliant string."),
  produces = @ContextDefinition("string",
    label = @Translation("CSS Color")
  ),
  consumes = {
    "color" = @ContextDefinition("any",
      label = @Translation("Color"),
      required = TRUE
    )
  }
)

Hierarchy

  • class \Drupal\social_branding\Plugin\GraphQL\DataProducer\ColorCSS extends \Drupal\social_graphql\Plugin\GraphQL\DataProducer\Entity\EntityDataProducerPluginBase

Expanded class hierarchy of ColorCSS

File

modules/social_features/social_branding/src/Plugin/GraphQL/DataProducer/ColorCSS.php, line 26

Namespace

Drupal\social_branding\Plugin\GraphQL\DataProducer
View source
class ColorCSS extends EntityDataProducerPluginBase {

  /**
   * Returns the CSS color.
   *
   * @param \Drupal\social_branding\Wrappers\Color $color
   *   The branding color.
   *
   * @return string
   *   The branding color CSS codification.
   */
  public function resolve(Color $color) : string {
    return $color
      ->css();
  }

}

Members

Namesort descending Modifiers Type Description Overrides
ColorCSS::resolve public function Returns the CSS color.