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). 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). UI Patterns (SDC in Drupal UI) 2.0.18 Minor update available for module ui_patterns (2.0.18). Varbase FAQs 9.2.1 Minor update available for module varbase_faqs (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 an AI tool to extract dominant colors from images using a local PHP library. It saves on AI token usage by handling color extraction directly. It can also automate updating text fields with extracted colors when content is saved.

About

Generic Colors is an AI Agent Tool for retrieving predominant colors from images using a local PHP library.
By using this tool you can save on tokens sent to the LLM if the task is just to retrieve predominant colors from images.

Installation and usage

The module needs the composer package `ksubileau/color-thief-php`.

Install as a Drupal module and head to the agents explorer page to test it.
Locate the tool in the dropdown, enter a file id or a media id and see the result.

Then it can be added as a Tool in any Drupal AI Agent.

Example response

dominant_color: '#bdada9'
colors:
- { color: '#c4aab7', percentage: 21.53 }
- { color: '#6edecd', percentage: 18.32 }
- { color: '#b9cb77', percentage: 14.55 }
- { color: '#d63280', percentage: 12.77 }
- { color: '#49d1da', percentage: 8.38 }
- { color: '#d967b4', percentage: 8.33 }
- { color: '#8ec3bf', percentage: 8.13 }
- { color: '#d51132', percentage: 3.67 }
- { color: '#dc31d3', percentage: 3.46 }
- { color: '#c4a952', percentage: 0.86 }

Use as an AI Automator

This module comes bundled with an automator which can be attached to
a multivalue text field. When a node is saved, the automator will call
the Generic Colors Tool with the configured image field and update the
node field with the colors received. Note that the Automator will have
to be manually added to the custom field. See attached image for field configuration.

Activity

Total releases
6
First release
Nov 2025
Latest release
7 months ago
Releases (12 mo)
6 ▲ from 0
Maintenance
Slowing

Release Timeline

Releases

Version Type Release date
1.0.0-alpha5 Pre-release Nov 25, 2025
1.0.0-alpha4 Pre-release Nov 24, 2025
1.0.0-alpha3 Pre-release Nov 24, 2025
1.0.0-alpha2 Pre-release Nov 24, 2025
1.0.0-alpha1 Pre-release Nov 19, 2025
1.0.x-dev Dev Nov 19, 2025