You are here

protected function AvailabilityCalendarsCssGenerator::addCssColorDeclaration in Availability Calendars 6.2

Same name and namespace in other branches
  1. 7.2 availability_calendars.styles.inc \AvailabilityCalendarsCssGenerator::addCssColorDeclaration()

Creates a CSS declaration for a color property.

See also

addCssDeclaration for param and return info

2 calls to AvailabilityCalendarsCssGenerator::addCssColorDeclaration()
AvailabilityCalendarsCssGenerator::createStatesCss in ./availability_calendars.styles.inc
AvailabilityCalendarsCssGenerator::createTableCss in ./availability_calendars.styles.inc

File

./availability_calendars.styles.inc, line 727

Class

AvailabilityCalendarsCssGenerator

Code

protected function addCssColorDeclaration($category, $name) {
  $value = $this
    ->getStyle($category, $name);

  // Color codes may be given without #
  if (!empty($value) && ctype_xdigit($value)) {
    $value = '#' . $value;
  }
  return $this
    ->cssDeclaration($name, $value);
}