Drupal is a registered trademark of Dries Buytaert
Protected Pages 3.0.0 Major update available for module protected_pages (3.0.0). Commerce Core 3.3.8 Minor update available for module commerce (3.3.8). Search API HTML Element Filter 1.0.7 Minor update available for module search_api_html_element_filter (1.0.7). Layout Builder Reorder 2.0.1 Minor update available for module layout_builder_reorder (2.0.1). Ban 1.1.0 Minor update available for module ban (1.1.0). Field Formatter Range 2.0.0 Major update available for module field_formatter_range (2.0.0). Field Formatter Range 8.x-1.8 Minor update available for module field_formatter_range (8.x-1.8). Varbase Media Header 9.2.1 Minor update available for module varbase_media_header (9.2.1). Search API Solr 4.3.11 Module search_api_solr updated after 14 months of inactivity (4.3.11). Provus Mega Menu Module provus_mega_menu crossed 1,000 active installs.

This module provides a "Color" field type that allows users to select colors using hexadecimal notation (HEX) and optionally include opacity. It offers various formatters for displaying colors, such as HEX codes, RGB(A) values, CSS declarations, and color swatches. Several widgets are included for color selection, including HTML5 color pickers and JavaScript-based options.

Color Field is simple field that use a hexadecimal notation (HEX) for the combination of Red, Green, and Blue color values (RGB).
Opacity is also supported and can be disabled/enabled per specific field instance.

Current features

Formatters

  • Plain text - as HEX code(#FF0080) or RGB(163,73,164) with or without opacity such as RGBA(0,0,255,1.0)
  • Css Declaration (color/background-color) - supports tokens
  • Color swatch - rectangle, circle or parallelogram

Widgets

Views

  • Tokens/Replacement Pattern in CSS Declaration in Views

Multiple fields on the same entity is supported either directly on the entity or
through Field Collections (Drupal 7) or Paragraphs (Drupal 7+) or other entity
reference methods.

Versions

Drupal 8+

Actively supported for Drupal 9.4 and over.

  • 3.0.x Drupal 9/10, Active development and functional branch. Has a test suite and tests are now required for most bug fixes and feature requests to be committed.
  • 8.x-2.x: Drupal 8/9. Minorly supported.
  • 8.x-1.x: Deprecated

Drupal 7

Predominantly unsupported except for security purposes.

  • 7.x-1.x: the stable and recommended version for most users
    and production sites. It has reached feature freeze and will not be getting
    any new features, only bug fixes.
  • 7.x-2.x offers a lot of new improvements and was
    the active Drupal 7 branch for new features and UI improvements.
    There is a stable release, but has had less testing than ideal
    Bugs fixed in 7.x-2.x will also be fixed in 7.x-1.x if possible. See the
    wiki page on differences between the 1.x and 2.x versions for more detailed
    information. You can upgrade from 1.x to 2.x but make sure to backup your DB.
    Please report any upgrade issues.

Basic installation

Drupal 8 & 9

Install however you normally install modules - see the User Guide.
Using composer is recommended - ideally, using
Asset Packagist to install dependencies as well.

Optional Libraries should be in the libraries/ folder

Drupal 7

Install as you normally install modules - see the documentation.
Installing via composer is recommended if you are using composer on your site.

Requirements

No hard requirements. However, to use some widgets with external JavaScript requirements,
the libraries module is needed.

Optional libraries should be in the sites/all/libraries/ folder

Drush Support

Color_field 7.x-2.x includes Drush commands to download optional JavaScript color picker
libraries (required for some widgets).

Optional Libraries

jQuery Simple Color Plugin

If you want to use the jQuery Simple Color plugin you need to download it via
composer/drush or manually and place it in your libraries folder with the folder
named jquery-simple-color

jQuery Spectrum Color Plugin

To use the spectrum widget, you need the jQuery Spectrum
library. Install with Composer/Drush or manually and name the folder bgrins-spectrum.
jQuery Spectrum requires jQuery v1.5.0 or later.

Usage

See the readme included with each version of the module for exact details.
As it is a field, the general process whether Drupal 7, 8 or 9 is:

  1. Add the field to a node/entity
  2. Select the Color field form widget type
  3. Select the Color widget you want

Credit

Websites reported to use the module

Activity

Total releases
3
First release
Mar 2025
Latest release
2 weeks ago
Releases (12 mo)
2 ▲ from 1
Maintenance
Active

Release Timeline

Releases

Version Type Release date
3.1.0-beta1 Pre-release Jun 30, 2026
3.1.x-dev Dev Jun 28, 2026
3.0.2 Stable Mar 31, 2025