November 21, 2024

Color makes everything better, and it’s an amazing way to help highlight elements, make the UI easier to use and read, and much more. The color function helps us use pre-defined colors that look good and refer to by name. There are other ways to specify your colors, like the ColorValue, RGBA, and ColorFade functions, to name a few.

Like everything, you should not go overboard with color in your app, but adding it goes a long way to have a good-looking app.

Usage

The color function works by adding to it the color you want.

Example:

Color.Burlywood

Will return:

It’s quite simple but powerful. There’s a full list in Microsoft’s Reference that describes all the system colors and their corresponding RGBA and HEX codes. 

Limitations

You need to call the colors by name. You can’t define any of its components, including transparency. It would be best if you used the ColorValue, RGBA, and ColorFade functions for that.

Recommendations:

Here are some things to keep in mind.

Use this function where you can

I like this function because it makes what color you’re using quite clear. Compare with the RGBA function where you have something like “RGBA( 222, 184, 135, 1 )” (the same color as above), and the difference is striking. When debugging your app, it’s quite easy to confuse numbers in the RGBA function, but names are easier to remember.

Things may change

On the other hand, colors may change. Microsoft can decide that the color named “Burlywood” needs a bit more transparency or a little bit more yellow, so your UI may suffer from that. If you define the RGPA color, you’re sure that you’ll always have the same color regardless of what changes are done.

Sources:

 Color enumeration and ColorFade, ColorValue, and RGBA functions in Power Apps 

Back to the Power Apps Function Reference

Manuel Gomes

I have 18 years of experience in automation, project management, and development. In addition to that, I have been writing for this website for over 3 years now, providing readers with valuable insights and information. I hope my expertise allows me to create compelling, informative content that resonates with the audience.

View all posts by Manuel Gomes →

Leave a Reply

Your email address will not be published. Required fields are marked *

Mastodon