# Multiple Color Palettes in G4P?

**URL:** <https://discourse.processing.org/t/multiple-color-palettes-in-g4p/45011>\
**Category:** Libraries\
**Created:** [August 30, 2024, 10:49pm UTC](https://discourse.processing.org/t/multiple-color-palettes-in-g4p/45011 "2024-08-30T22:49:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Thundercat](https://avatars.discourse-cdn.com/v4/letter/t/dbc845/32.png) [@Thundercat](https://discourse.processing.org/u/Thundercat)\
**Post date:** [August 30, 2024, 10:49pm UTC](https://discourse.processing.org/t/multiple-color-palettes-in-g4p/45011/1 "2024-08-30T22:49:55Z")

</div>

This is a question for Peter, and odd one.

After getting beta feedback from the app I made with your amazing library, some users asked for a way to edit colors.

While this is something I can do theoretically, there’s not enough colors available in G4P to do this - I’d need many sets of color palettes.

So, again, an odd request, probably not one you ever considered, but is there a way to have multiple gui palette files? Could I, on the fly, select any given gui palette somehow?

I would not be surprised if the answer is no, but I wanted to ask your thoughts.

Thank you so much again for all you’ve done for me, and for all of us, with G4P. It’s a wonderful achievement.

Mike

---

<div class="post-metadata">

**Author:** ![quark](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/quark/32/26_2.png) [@quark](https://discourse.processing.org/u/quark)\
**Post date:** [August 31, 2024, 1:32pm UTC](https://discourse.processing.org/t/multiple-color-palettes-in-g4p/45011/2 "2024-08-31T13:32:05Z")

</div>

> [@Thundercat](#):
>
> some users asked for a way to edit colors.

By that I assume that they would like to change the overall GUI _colour scheme_ rather than individual elements that make up a control. Allowing users to change the colours used by different elements of a control in your app is _ **definitely** _ not recommended.

> [@Thundercat](#):
>
> While this is something I can do theoretically, there’s not enough colors available in G4P to do this - I’d need many sets of color palettes.

G4P has support for 16 colour schemes of which 8 are predefined but even these can be redefined so you could provided the user with 16 custom schemes to choose from That seems a goodly number 😀.

The process is quite simple but a bit tedious to create an aesthetically pleasing scheme. The process is described on my website [here](http://www.lagers.org.uk/g4p/guides/g04-colorschemes.html).

Once you have created your 16 schemes the statement

```auto
G4P.setGlobalColorScheme(schemeNbr(;
// where `schemeNbr` in in the range 0 to 15

```

will change the colour scheme used by _every_ control in your app.

---

<div class="post-metadata">

**Author:** ![Thundercat](https://avatars.discourse-cdn.com/v4/letter/t/dbc845/32.png) [@Thundercat](https://discourse.processing.org/u/Thundercat)\
**Post date:** [August 31, 2024, 2:07pm UTC](https://discourse.processing.org/t/multiple-color-palettes-in-g4p/45011/3 "2024-08-31T14:07:01Z")

</div>

Yes, as I thought.

The device I made the app for has 32 color sets. 32 x 16. He wanted me to change the color of the screen and text to match the device.

I told the user there was a limit to the colors available.

No worries - this is not even something I would expect or suggest you implement, and it’s an odd one.

I may be able to cheat and do a little workaround, but I had never intended to implement the feature the user requested.

And I probably won’t even try.

Many thanks 🙏 Peter!!

Mike
