cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Kudo Commander
Kudo Commander

Using ColorValue() with RGBA()

Hi,

I have a text string like this

"rgba( 215,50,19,1)"

 

and I want to use it as fill color for a value.
--> Error Message: "Expected color value".

So I tried this function:

"ColorValue("rgba( 215,50,19,1)").

No Error message, but Color is black and not red.

 

Can any body help?


5 REPLIES 5
Super User III
Super User III

Are you picking the colors from variable or how exactly did you apply in the app.

You can try

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

Community Support
Community Support

Hi @max81 ,

Do you want to fill a color for a value based on the Text string "RGBA(215,50,19,1)"?

 

Based on the formula that you mentioned, I found that there is something wrong with it. The ColorValue() function is only accept CSS Color name (e.g. "RoxyBrown"), or 6-digit hex value or 8-digit hex value as its argument. You could not specify the "RGBA(215,50,19,1)" within the ColorValue function.

Please check the following article for more details:

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-colors

 

If you want to use ColorValue within your canvas app, you should use the following formula:

ColorValue("#D73213")      // RGBA(215,50,19,1)

 

More details about supported CSS Color Name and 6-digit hex value, please check the following article:

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-colors#built-in-colo...

 

If the RGBA() Text String is from your data source, please consider store the CSS Color Name or 6-digit hex value or 8-digit hex value in your data source instead of the "RGBA(215,50,19,1)", then you reference it within the ColorValue() function.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @v-xida-msft,

hi @eka24 

 

thanks for your answers.

 

I got the "rgba(..)" string from Connector "PowerAppsforMakers" or "PowerAppsforAdmins" out of the "properties.backgroundColor" and I want to show in my app the correct App Icon.

 

I also have read the function reference, but I'm confused, because I saw that this function works in the "Center of Excellence" for example in the app "Set New App Owner". (see screenshot).

 

 

Hi @max81 ,

Thanks for your feedback. Yeah, I see it. Currently, within single canvas app, you could not use the RGBA(..) Text value within the ColorValue.

 

I guess that within the "Set New App Owner" template app of the "Center of Excellence", the ThisItem.properties.backgroundColor formula has been changed into supported color string in a CSS in underlying, although, theThisItem.properties.backgroundColor formula returns a text value.

 

I would post this issue to my Product Team, if there are any updates on this issue, I would reply here.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@v-xida-msft :
Please see the new attached screenshot.
I've just added a new label to see the returned string for ThisItem.properties.backgroundColor. It's just the rgba(...) string.

 

The Items propertie for the gallery is:

Filter(PowerAppsforAdmins.GetAdminApps(galEnvironments.Selected.name,{'$top':1100}).value, txtSearchText.Text in properties.displayName || txtSearchText.Text in properties.owner.displayName)

 

Thanks for your support 

Helpful resources

Announcements
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

Top Solution Authors
Top Kudoed Authors
Users online (68,978)