User tests: Successful: Unsuccessful:
Update color form field type use to latest jQuery minicolor. Adds support for rgba colors with new attributes format
and opacity
.
Create two color fields and check if everything works like expected.
Expected: results in hex
color and hasn't opacity picker.
<field
name="colorhex"
type="color" />
Expected: results in rgb
color and hasn't opacity picker.
<field
name="colorrgba"
type="color"
format="rgb" />
Expected: results in rgba
color and has opacity picker.
<field
name="colorrgba"
type="color"
format="rgb"
opacity="0.5" />
Status | New | ⇒ | Pending |
Labels |
Added:
?
|
Category | ⇒ | External Library JavaScript |
Category | External Library JavaScript | ⇒ | External Library Fields JavaScript |
Thanks @andrepereiradasilva. Yes, this seems more logical. Although currently there is no default attribute used, I will add it so we can have these options you described. To be clear, colordefault
is short for colorhex
in your example?
To be clear, colordefault is short for colorhex in your example?
Since the default value for format
is hex
, yes.
Hi @renekorss do you know there's already a PR for this?
#7602
In the same, you're not exactly implenting it in joomla as it was meant to be.
I'm currently on holidays, and didn't have enough free time in March, but will do the updated PR when back.
Thanks!
Status | Pending | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2016-04-03 09:16:11 |
Closed_By | ⇒ | renekorss |
@renekorss PR is done: #10129 ! ;-)
As you will see, comparing to my first PR, i have integrated your idea about the placeholder
What was missing in your PR was the keywords, but too the specificity of Joomla with validate=color which was to be taken into account for B/C reason (an old (not needed anymore as minicolors auto-validate input) validatation on color requiring a HEX value, to be disabled when usage of rgb(a) and when set in a form field, to not break validation and B/C behavior).
Ready for testing ? ;-)
instead of making the colorpicker only rgba when you add the opacity="" parameter why not make an rgbaformat and drop the opacity (i think it can be setted in the default attribute as others right?).
@andrepereiradasilva this is how i did it for joomla ;-)
The minicolors.js picker does not need to set a data-opacity, only if you want to set a default opacity (not really useful here, but all changes in library were done for B/C compatibility of the library itself. As Joomla was not using opacity before, i could go another way with 3 formats: hex, rgb and rgba, and so to simplify the xml attribute ;-) )
This seems a nice change. But some improvements IMHO are needed.
tested the following fields
result:
instead of making the colorpicker only rgba when you add the
opacity=""
parameter why not make anrgba
format and drop the opacity (i think it can be setted in thedefault
attribute as others right?).So we could have this