kallookoo / wp-color-picker-alpha

Overwrite Automattic Iris for enabled Alpha Channel in wpColorPicker
GNU General Public License v2.0
131 stars 87 forks source link

Allow alpha in different formats #50

Open gerardreches opened 2 months ago

gerardreches commented 2 months ago

Right now alpha values are only available in rgba format.

This is an issue when for example the field value is pre-populated with an 8-digit HEX value.

It also makes impossible to replace the wpColorPicker palette with 8-digit HEX values.

kallookoo commented 2 months ago

That's right, since rgba support was more widespread than other formats. When I have a moment I will look at how to select the format that should be returned.

gerardreches commented 2 months ago

Thanks!

Besides being able to choose the returned format, would it be possible to also allow any format when prepopulating the input field? When prepopulating the palette as well.

kallookoo commented 1 month ago

Hi,

Check this branch; https://github.com/kallookoo/wp-color-picker-alpha/tree/issue-50

It is not tested with the palettes and review the Readme to know what options you have because by default it returns an rgba, but there is an option to modify its behavior.

sutersoftware commented 2 weeks ago

That's exactly what I needed too. Thank you very much. Version 303+50 works great for me.

gerardreches commented 2 weeks ago

Using this version and setting data-alpha-color-type to octohex worked!

The palettes seem to be working as well.

Screenshot 2024-06-22 at 15 36 12 Screenshot 2024-06-22 at 15 38 28
gerardreches commented 2 weeks ago

@kallookoo Could we get this merged any time soon? Thank you!