The ColorPicker stores the color in hex format. While it has an output option to produce rgb output, it doesn't do rgba. So a custom output modifier is required. From a Slack conversation.
I've a problem with the color picker TV (Color Picker) in a resource: I try to get it in RGB - Mode, but no chance. What I did is set the output type to "RGB" but it always outputs Hexadecimal code. I use it in a _tpl via getressource but I dont think that matters. Any experiences with that? Thanks a lot!
As I see the RGB wouldnt even solve my problem because I need "rgba". I dont think I get only the values, f.e 121,2,56 out of colorpicker do I?
It only supports rgb. The "a" part would have to be another option field. Converting the color is simple enough, adding the opacity has to depend on further input. Sounds like you need a custom output modifier so you could say.
Here's the tested snippet to use Hex2RGBA
What's the Story?
The ColorPicker TV stores the TV value in hex form. It provides output options to convert to rgb, but if you need rgba that won't be enough. So a custom output modifier can be used to convert the raw hex value to rgba. The output modifier takes an option, "opacity", to set the opacity of the final rgba value.
This solution uses a function from a mekshq.com blog post.