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

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

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>';
}