verbb / color-mixer

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

FR: RGB to Hex #2

Closed RobErskine closed 2 years ago

RobErskine commented 5 years ago

Hey there. I love this plugin. I would love the ability to convert from RGB to Hex. Is there any way we can convert the private function rgbToHex to a public function?

https://github.com/whoisjuan/craft-color-mixer/blob/v1/src/twigextensions/CraftColorMixerTwigExtension.php#L363

If you're open to pull requests let me know and I can submit that and update the documentation! Thanks ;D

whoisjuan commented 5 years ago

Yeah! If you want, please send a PR and I will merge it! Cheers!

engram-design commented 2 years ago

We've revamped the color conversion filters to support converting from and to just about anything in 3.0.0

For this, you can use {{ 'rgb(255,0,255)' | toHex }}

Check out the updated docs for more.