Skip to main content

Notifications

Community site session details

Community site session details

Session Id : alhlOysN6o0X35OAWaXvDX
Power Apps - Building Power Apps
Answered

Using String in RGBA format as Color Value

Like (1) ShareShare
ReportReport
Posted on 26 Jun 2024 13:58:12 by 1,272 Super User 2025 Season 1

I have a Collection of color values in "RGBA(####,####,####,#.#)" format. When I use this as a color value:

LookUp('App Style Guide',Name = "App Bar Fill").RGBA

 

which outputs:

RGBA(0,0,0,1)

 

But when I use that as the color value for something I get "Expected Color Value". My workaround is to put the "RGBA" text on the outside and then pull in the values for the numbers individually:

RGBA(
 LookUp('App Style Guide',Name = "App Bar Fill").R,
 LookUp('App Style Guide',Name = "App Bar Fill").G,
 LookUp('App Style Guide',Name = "App Bar Fill").B,
 LookUp('App Style Guide',Name = "App Bar Fill").A
)

 

Categories:
  • Suggested answer
    CarlosFigueira Profile Picture
    on 29 Jan 2025 at 17:37:04
    Using String in RGBA format as Color Value
    If you have the color in the RGBA(<number>, <number>, <number>, <number>) format, you can use an expression like the one below to extract the components and create the color:
    With(
        Match(
            LookUp('App Style Guide',Name = "App Bar Fill").RGBA,
            "RGBA\(\s*(?<r>\d+)\s*,\s*(?<g>\d+)\s*,\s*(?<b>\d+)\s*,\s*(?<a>[\d\.]+)\s*\)"),
        RGBA(Value(r),Value(g),Value(b),Value(a))
    )
    If you already have the components in your 'App Style Guide' table, you can use a With call to make the expression a little simpler:
    With(
      { fillColor: LookUp('App Style Guide',Name = "App Bar Fill") },
      RGBA(fillColor.R, fillColor.G, fillColor.B, fillColor.A)
    )
    Hope this helps!
  • IPC_ahaas Profile Picture
    1,272 Super User 2025 Season 1 on 27 Jan 2025 at 14:44:22
    Using String in RGBA format as Color Value
    Unfortunately converting or storing the values as HEX seems to be the only solution. My resulting code looks like this:
     
     
    ColorValue(LookUp('App Style Guide', Name = "App Bar Fill").'Color HEX')
  • Verified answer
    MichaelFP Profile Picture
    1,831 Super User 2025 Season 1 on 26 Jun 2024 at 14:07:49
    Re: Using String in RGBA format as Color Value

    Why you store as hexadecimal value and using ColorValue("#FFFFF") to set the color?

     

    If my answer helped you, please give me a thumbs up (๐Ÿ‘). If solve your question please mark as solution โœ”๏ธ. This is help the community.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

๐ŸŒธ Community Spring Festival 2025 Challenge Winners! ๐ŸŒธ

Congratulations to all our community participants!

Warren Belz โ€“ Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Communityโ€ฆ

Leaderboard > Power Apps - Building Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 285 Most Valuable Professional

#2
MS.Ragavendar Profile Picture

MS.Ragavendar 146

#3
stampcoin Profile Picture

stampcoin 130

Overall leaderboard
Loading complete