Dominant Color
A WordPress plugin to automatically save the dominant color and a color palette for an attachment image into post_meta.
A WordPress plugin to automatically save the dominant color and a color palette for an attachment image into post_meta.
Screenshots & previews.
The dominant color and color palette is automatically saved on upload and edit to post meta.
You need to then use get_post_meta to retrieve the “dominant_color_hex” or “dominant_color_rgb” meta key. hex returns a string, including the #, rgb returns an array with key 0 as red, 1 as green, and 2 as blue.
Alternatively, you can use the meta keys “color_palette_rgb” and “color_palette_hex” to get an array of 8 colors that feature prominently in the image.