Home>Support>Implement rgba to colorpicker

Implement rgba to colorpicker

Default wordpress color picker do not support alpha channel. To turn it on in SiteBuilder I use:

1. wp-color-picker-alpha plugin (https://github.com/23r9i0/wp-color-picker-alpha)
2. and dirty Siteorigin Panels core hack:

/plugins/siteorigin-panels/inc/styles.php

line 183: add data-alpha=”true” attr

<input type="text" name="” value=”” class=”so-wp-color-field” data-alpha=”true” />

line 332: HEX/RGBA/HSLA validation

if ( preg_match(‘/(#(?:[0-9a-f]{2}){2,4}|#[0-9a-f]{3}|(?:rgba?|hsla?)((?:d+%?(?:deg|rad|grad|turn)?(?:,|s)+){2,3}[s/]*[d.]+%?))/i’, $color ) ) $return[$k] = $color;

Is this possible without plugin core hack? Or maybe you can implement this in future plugin releases?

Thank you!

This is our free support forum. Replies can take several days. If you need fast email support, please purchase a SiteOrigin Premium license.

Get The Most Out of SiteOrigin with SiteOrigin Premium

Find Out More