In today’s article, I would like to share a quick solution i’ve put in place for one of my projects, where the colours keep changing and I wanted to be ready for any theme changes when required.

The different theme colours would be stored in a collection which will be referenced by the different Power Apps controls instead of hard coded.

I have created a simple screen, which allows me to set the different colours such as:

  • Button fill,
  • Button text,
  • Border,
  • Chevron background colour …etc.

I wanted also to view the rendering of the most used controls:

  • Textbox
  • Text input
  • Dropdown

Application Strucure

The app has one screen only, with two containers:

Colours definition

In the left section, you will be able to set the different colours,

The colours values are expected in Hex format, we will use the ColorValue function to convert the colours to RGBA format.

If you want to learn more about ColorValue, ColorFade and different ways to convert hex to rgba and apply transparency, please visit the Microsoft reference ->

Color enumeration and ColorFade, ColorValue, and RGBA functions in Power Apps – Power Platform | Microsoft Learn

In addition, this panel, will render the collection definition, which you can just copy and paste in your project.

Preview panel

This area is the preview area, it allows you to view and amend the colours if you are not happy with the results.

Enjoy !

 

Download from GitHub

The app code is available from –>

https://github.com/samirlogisam/CanvasControlsTheme

1
Show Buttons
Hide Buttons

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.