web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Change the Alpha Value...
Power Apps
Answered

Change the Alpha Value of RGBA derived from a Variable?

(0) ShareShare
ReportReport
Posted on by 311

I have a variable which defines a "colour scheme" from my App, based on Slider Values selected by the User:

Set(varFillColour,RGBA(Slider2.Value,Slider2_1.Value,Slider2_2.Value,(Slider2_6.Value/100)))

 

These Values are stored in a DataVerse Table and read every time the User opens the App. It works for both the Fill and Color Properties of various Objects on a Screen. However, in some instances, I need to change the Alpha Value from within that defining RGBA Variable - but only for the individual Object where it is in use. I am trying to "fade out" some Objects, based on the colour scheme selected by the User.

 

Is there a way to extract or "read" the details of my varFillColour variable - and then to change one Value only (in my case the element which defines the Alpha Value in an RGBA definition) for a single Object - without that change affecting the Global implications of the Variable?

Thanks!

Categories:
I have the same question (0)
  • timl Profile Picture
    36,774 Super User 2026 Season 1 on at

    Hi @AdamGill1965 

    A good start would be to look at this excellent post by @iAm_ManCat. That describes how to extract the alpha value from a colour.

    https://powerusers.microsoft.com/t5/Building-Power-Apps/ColorFade-and-Alpha-value/m-p/2126067

     

     

     

  • Ami K Profile Picture
    15,687 Super User 2024 Season 1 on at

    @AdamGill1965 - could you declare the Global Variable with something like this:

     

    Set(
     varFillColor,
     {
     R: Slider2.Value,
     B: Slider2_1.Value,
     G: Slider2_2.Value,
     A: (Slider6.Value/100)
     }
    );

     

    And then update the Alpha value for that specific object only? E.g.:

     

    RGBA(
     varFillColor.R,
     varFillColor.B,
     varFillColor.G,
     0.5 //whatever value you want to apply for the object
    )

     

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

     

    If I have answered your question, please mark your post as Solved. Remember, you can accept more than one post as a solution.

    If you like my response, please give it a Thumbs Up.

    Imran-Ami Khan

  • LaurensM Profile Picture
    12,516 Moderator on at

    Hi @AdamGill1965,

     

    A possible workaround could be storing the Red, Green and Blue values as a concatenated string in your table.

     

    //The value to be saved in the new text column
    $"{Slider2.Value};{Slider2_1.Value};{Slider2_2.Value}"

     

    Afterwards, you can easily reference the values by splitting that text column and changing the alpha value. (Let's call that column colorConcat):

     

    With(
     //colorConcat should also have a record reference (LookUp...)
     {wColor: Split(colorConcat,";")},
     RGBA(
     Index(wColor,1).Value,
     Index(wColor,2).Value,
     Index(wColor,3).Value,
     //Change to the correct slider reference
     (Slider2_6.Value/100)
     )
    )

     

    If this solves your question, would you be so kind as to accept it as a solution & give it a thumbs up.

    Thanks!

  • AdamGill1965 Profile Picture
    311 on at

    Thank you however this breaks the formula set for a Value in RGBA(0,0,0,0)

  • AdamGill1965 Profile Picture
    311 on at

    I apologize for not explaining fully - the Slider Values are used to initially set the Values for RGBA. The User then PATCHes those Values to their Profile Record, so that the next time the User logs in, it reads their colour preferences from that Record (a Dataverse Table). I am now inclined to believe that I will need to find a different method entirely to achieve what I need - but I really do appreciate your suggestions!

  • Verified answer
    AdamGill1965 Profile Picture
    311 on at

    I resolved this and created a demo:

    https://www.reddit.com/r/PowerApps/comments/15yl49i/i_made_a_thing_let_me_know_if_you_think_its/

     

    Adam

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 530

#2
WarrenBelz Profile Picture

WarrenBelz 459 Most Valuable Professional

#3
Haque Profile Picture

Haque 314

Last 30 days Overall leaderboard