cancel
Showing results for 
Search instead for 
Did you mean: 
0 Kudos

Add function to make colors transparent

Just like we have ColorFade we need to have a function called ColorOpacity. 

The only place where you can currently adjust the opacity or transparency of a color is using RGBA() function. 

 

Sometimes (very often) when building an app you reference colors previously used in the app, e.g. setting the Fill of a rectangle to be: Button_1.Fill, and sometimes you want to make this transparent. 

 

I've only found one way to do this dynamically, and that is by using JSON to extract the HEX code, and then replacing the final two characters with e.g. 80 to make it 50% transparent. 

 

Set(glbColorHex,Left(Substitute(JSON(Button1.Fill,JSONFormat.IgnoreUnsupportedTypes),Char(34),"") , 7) & "80")

 

And this can only be done as an 'action', that means when pressing a button. 

 

So either we need to be able to extract the RGB values from a Fill or BorderColor etc. so that we can manipulate the Alpha ourselves, or we need to be able to use a function like ColorOpacity, in the same way we use ColorFade. 

 

E.g.:

ColorOpacity(Button_1.Fill, 50%)

 

 

Status: New