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!
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
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!
Thank you however this breaks the formula set for a Value in RGBA(0,0,0,0)
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 - 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
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
WarrenBelz
42
Most Valuable Professional
mmbr1606
41
Super User 2025 Season 1
MS.Ragavendar
36