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

Notifications

Announcements

Community site session details

Community site session details

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

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,383 Super User 2025 Season 2 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,679 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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard