Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Quite simply I have a value in my data model called ColorRGB that returns a color value in this form:
RGB(222, 0, 222)
I use this to conditionally format the the background color of a card visual (First - Field Value, and select ColorRGB).
What I need is a measure that can read the color in that format, and return either black or white depending on the background color (white for darker colors, black for lighter colors). I'm trying to avoid parsing the RGB values out of that string, hoping there's an easier way. Obviously I want to also conditionally set the font color so it shows up with some contrast against whatever background color is being displayed.
Thanks!
Solved! Go to Solution.
Hi @bvy
Using color strings like that I think you will have the parse the string to figure out what color it is.
But you can use known CSS color names in your CF
Using these will make it a lot easier to know what color is being applied to the BG as you just need to check for specific color names e.g. "red", "firebrick" etc.
Regards
Phil
Proud to be a Super User!
Hi @bvy
Using color strings like that I think you will have the parse the string to figure out what color it is.
But you can use known CSS color names in your CF
Using these will make it a lot easier to know what color is being applied to the BG as you just need to check for specific color names e.g. "red", "firebrick" etc.
Regards
Phil
Proud to be a Super User!
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
112 | |
100 | |
76 | |
64 | |
63 |
User | Count |
---|---|
142 | |
105 | |
102 | |
80 | |
67 |