Hello,

I've created an drupal8 Theme which is compatible with the color module. It is possible to change the theme images with a specified color. You can fill an image or set a gradient for example.

But i've an icon which i want to change to another color. Is it possible to replace an color of an image with the color module?

If it's not possible, what is the best way to extend the color module, so i can do it myself with imagemagick?
For example: http://www.laurivan.com/replace-a-colour-in-an-image-with-imagemagick/

greetings!

Comments

VM’s picture

Frenske’s picture

lol... Maybe I did not explained it enough, but the color module works fine. I can change the css colors.

I've used the 'color module' documentation for adding this functionality in my theme. But i can not find anything in the documentation about replacing a color in an image. (Only fill or gradient ) Therefore my question if anybody knows if it possible, and if not, what's the best practice for extending the module.

VM’s picture

You explained well enough. I'm guessing you didn't read through the results in the same manner I did in and effort to answer your question.

The images the color modules works with are transparent background images. Documentation indicates this. As such, in its current form it colors or gradients and doesn't replace colors.

You extend by digging into the api which is also one of the results provided.

http://www.laurivan.com/replace-a-colour-in-an-image-with-imagemagick/ - is being used at the command line. As far as I can tell entending the core color.module isn't how you want to tackle this. My thought is you will need to write a custom module for your 'icons' that interacts with the color module.