4rn0/statamic-image-colors
A Statamic addon that extracts dominant colors from uploaded images, so you can build palettes for backgrounds, overlays, and theme accents directly in your templates. Lightweight, easy to configure, and handy for dynamic, image-driven design.
Architecture fit
imagecolors key with colors, stamp and color is the right call: computed data is colocated with the asset, reads at render time are free (no per-request image processing), and the namespacing makes the addon's write surface auditable.imagecolors already exists) is defensive and correct for a v1 addon, but it converts a potential data-clobbering bug into a silent no-op, which shifts the burden to operations.Integration feasibility
Technical risk
{{ hero:color }} and {{ hero:colors }} are removed in a 1.0.1 patch release. That is a breaking template change shipped under a patch version. Any consumer resolving ^1.0 gets hard render failures on upgrade. Pin the exact version and treat this as a major.imagecolors value will now be skipped rather than sampled. Sites upgrading with real content need a backfill/repin plan, not just a deploy.{{ if hero:imagecolors:color:is_dark }} were always false and now evaluate correctly. That is a bug fix, but any template that shipped with a workaround — or that relied on the branch never rendering — will change output. This is a visual regression risk, not an error.Key questions
:color / :colors?stamp invalidate — does replacing an asset's file trigger re-extraction, or do pinned/stored colors go stale silently?Stack fit
ImageColors type with the same three fields as the Antlers tag means headless and server-rendered consumers share one mental model — genuinely useful for teams running a hybrid front end.Migration path
:color and :colors usage on asset URLs, including inside {{ if }} blocks.imagecolors in blueprints, fieldsets, and existing asset meta to find collision candidates before they silently suppress extraction.{{ hero:color }} → {{ hero:imagecolors:color }}, {{ hero:colors }} → {{ hero:imagecolors:colors }}, and format variants via :color.ImageColors type.imagecolors values need a decision — rename the conflicting field, or accept the asset as unmanaged.Compatibility
imagecolors value from a prior install will be treated as foreign and excluded — so the upgrade path is not "install and run," it's "audit, then install."Sequencing
:color / :colors usage and imagecolors collisions.composer.json — do not float on ^1.0.Maintenance
Support
:contrast matters operationally: it measures against the solid color, not against text over the photograph. Anyone who built a hero on the old example has an accessibility problem, not just a cosmetic one. Treat the doc fix as a trigger to re-audit any shipped text-over-image component and check contrast properly against the actual backdrop.Scaling
stamp, repeat extraction should be incremental rather than a full re-scan — confirm that before scheduling a nightly job.Failure modes
:color / :colors syntax fails loudly at render. Painful but safe — this will be caught in staging, not production.stamp doesn't invalidate, the site keeps rendering the old color — potentially a brand color from a photo that no longer exists. Verify the invalidation path explicitly.Ramp-up
:color format modifiers, the is_pinned / is_dark / contrast accessors, and the GraphQL type are all straightforward — the real time sink is the audit and the template rewrite, not learning the API.How can I help you explore Laravel packages today?