cancel
Showing results for 
Search instead for 
Did you mean: 

Functions for decoding RGBA colors

Hi,

It would be nice if we could have some way to decode RGBA colors. It would be usefull for example when creating components and we want to separate an input color specified with RGBA function into its red, green, blue and alpha values.

Functions like these would be much appreciated:

  • GetRedValue(<some RGBA color>)
  • GetGreenValue(<some RGBA color>)
  • GetBlueValue(<some RGBA color>)
  • GetAlphaValue(<some RGBA color>)

Or maybe just one function that grabs them all:

  • DecodeRGBA(<some RGBA color>, <variable for red value>, <variable for green value>, <variable for blue value>, <variable for alpha value>)

Emmanuel

Status: New
Comments
Level: Powered On

I really like the idea of accessing the R, G, B, A codes of a Color Datatype.

And maybe it could even be possible without extra functions?

 

Say we collect a record like this

Collect(colTest,{col1: Screen1, col2: RGBA(255,0,0,1)})

 

col1 is a Control Datatype (where we can access col1.Name, col1.Fill, etc. of Screen1)

col2 is a Color Datatype. It would be nice if we could access col2.Red, col2.Green, col2.Blue, col2.Alpha.

 

Level 10

Hi @Gabrz,

Yeah, sure, that could do the trick as well. It's a good idea... 👍