How to: Change Colors in the App

These instructions assume that you already have the following prerequisites:

  • Visual Studio 2022 and Maui installed.
  • Source code. To get access to the link to the source code, contact LS Retail Technical Support.
  • You are able to build and run the unchanged code.

To change colors inside Visual Studio

  1. Open the project in Visual Studio, and locate a file called App.xaml:

  2. When you have opened the file, there are two colors that we recommend changing if you want to customize your app. These are the “Primary Color” and “Secondary Color”. You must specify colors as a hex number. You can use this URL to convert colors to a hex number.
  3. You leave the text "Primary Color" and only change the hex string. The hex string is the green highlighted text in the below example:

    <Color x:Key=”PrimaryColor”> #223B2C</Color>

  4. When you have finished picking your color, build and run the app, and the primary color of the app should have changed.

The image shows all colors used in the app:

To change colors with scripts

  1. Navigate to this place in the folder you downloaded /ScanGo/Forms/ScanPayGo/Customization
  2. Right-click UpdateColors.ps1, and select Run with PowerShell.
  3. When you have run the script, you are prompted with:

    Enter new color for SecondaryColor as a hex value, leave empty if it should be unchanged

  4. This is repeated for every color that is used in the app, but we recommend to only change the PrimaryColor and SecondaryColor. To change the color of the app you will have to enter a hex value for your color.