This post is to show how to change the color of a Text / Label / Button etc.. dynamically
We can set the text color by specifying the color in the color attribute, if we want to set the color with a static value.
ex:-
But if you want to set the value dynamically, we can use a variable. But in this case we will have to use the ColorValue() function to achieve the expected result.
In the below example, on the button click, I am setting the dynamic variable to the value from the text box
Set(labelColor,TextInput1.Text)
ColorValue(labelColor)
Reference: Color enumeration and ColorFade, ColorValue, and RGBA functions in Power Apps
Feel free to point out if anything is wrong/missing in this post.
No comments:
Post a Comment