grav-plugin-admin
grav-plugin-admin copied to clipboard
Colorpicker format and validation
With Admin v1.10.30.1, the colorpicker seemingly supports two formats: Hex and RGBA, but not RGB.
For example, when a blueprint uses the color rgb(255, 138, 128)
, it renders fine:
When you click the field, the colorpicker-composes interprets it as a hex-value and transforms it into #ff8a80
:
If you then click the transparent-button, it gets interpreted back to RGB with an alpha-channel set to 0:
Whereas it should be rgba(255, 138, 128, 1.00)
. But why isn't RGB simply supported? With a simple list of colors, like
colors:
- name: White
value: "rgb(250, 250, 250)"
- name: Red
value: "rgb(255, 138, 128)"
- name: Orange
value: "rgb(255, 209, 128)"
these will not fit the pattern-validation, and when trying to save settings in a blueprint it will practically go through each one, transforming them to the nearest Hex. Is the solution #921 not sufficient?