Drupal is a registered trademark of Dries Buytaert
drupal 11.3.7 Update released for Drupal core (11.3.7)! drupal 11.2.11 Update released for Drupal core (11.2.11)! drupal 10.6.7 Update released for Drupal core (10.6.7)! drupal 10.5.9 Update released for Drupal core (10.5.9)! cms 2.1.1 Update released for Drupal core (2.1.1)! drupal 11.3.6 Update released for Drupal core (11.3.6)! drupal 10.6.6 Update released for Drupal core (10.6.6)! cms 2.1.0 Update released for Drupal core (2.1.0)! bootstrap 8.x-3.40 Minor update available for theme bootstrap (8.x-3.40). menu_link_attributes 8.x-1.7 Minor update available for module menu_link_attributes (8.x-1.7). eca 3.1.1 Minor update available for module eca (3.1.1). layout_paragraphs 2.1.3 Minor update available for module layout_paragraphs (2.1.3). ai 1.3.3 Minor update available for module ai (1.3.3). ai 1.2.14 Minor update available for module ai (1.2.14). node_revision_delete 2.0.3 Minor update available for module node_revision_delete (2.0.3). moderated_content_bulk_publish 2.0.52 Minor update available for module moderated_content_bulk_publish (2.0.52). klaro 3.0.10 Minor update available for module klaro (3.0.10). klaro 3.0.9 Minor update available for module klaro (3.0.9). layout_paragraphs 2.1.2 Minor update available for module layout_paragraphs (2.1.2). geofield_map 11.1.8 Minor update available for module geofield_map (11.1.8).

color_field

44,921 sites Security covered
View on drupal.org

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
1
First release
Mar 2025
Latest release
1 year ago
Release cadence
Stability
100% stable

Releases

Version Type Release date
3.0.2 Stable Mar 31, 2025