You are here

function theme_color_swatch in Color Field 7.2

Same name and namespace in other branches
  1. 7 color_field.module \theme_color_swatch()

Formats a color swatch.

1 theme call to theme_color_swatch()
color_field_field_formatter_view in ./color_field.field.inc
Implements hook_field_formatter_view().

File

./color_field.theme.inc, line 186
Theming functions.

Code

function theme_color_swatch($variables) {
  $color = check_plain($variables['color']);
  $width = check_plain($variables['width']);
  $height = check_plain($variables['height']);
  return '<div class="color-swatch" style="background-color: ' . $color . '; width: ' . $width . 'px; height: ' . $height . 'px;"></div>';
}