verbb / color-mixer

A set of Twig filters for modifying hex colors in Craft CMS.
MIT License
12 stars 4 forks source link

Function collision with another plugin #8

Closed brimby closed 2 years ago

brimby commented 4 years ago

The plugin called colorit has a function called hexToRgb too, and when I try to use the hexToRgb filter the colorit one is taking priority over the craft-color-mixer one. So I don't know if you could get together with the colorit dev and rename one of your functions or what. His function is less useful because it prints "rgb(0,0,0)" instead of just "0,0,0" so it can't be inserted into an rgba() without using the array.

You can view the colorit hexToRgb function here

whoisjuan commented 4 years ago

@brimby Changing the function name in Color Mixer or Colorit may not be viable since it automatically would break code for many people and I don't think there's is a low friction way to deprecate.

It seems that Colorit also gives access to their functions via utilities so for this particular situation, I would rely on their utilities {{ craft.colorit.colours.hexToRgb(hex) }}.

Color Mixer relies exclusively on Twig filters so it doesn't have this alternative.