Ability to set both light and dark mode colours of a ColorGroup in the IDE

Feedback Case Number: 69648

I use ColorGroups extensively in my custom controls as they work really well for me.

Currently there is no way to set both the light and dark mode colour for a ColorGroup property in the IDE. In the inspectors, you can only set a single colour (the light mode colour) for ColorGroup properties.

If you’d like to see a way to do this in the IDE, please thumbs up the feedback case above (since this seems to be the only way to get Xojo to implement a feature request).

Not being able to set both values in the IDE really lowers their usefulness.

2 Likes

Do you have the wrong word in your title and post? You can set Light and Dark mode colours, that’s the point of ColorGroup. The ticket linked is for displaying them simultaneously.

To set both colours, select “Dual” mode. The Light mode colour is on the left, indicated by the light background. The Dark mode colour is on the right, indicated by the dark background.

Color Group Setup

3 Likes

What I understand is that case is asking that instead of seeing this:
image

to see something like this:
Monosnap 2023-08-30 14-36-13

Yep Tim, Alberto is correct. I want a way to choose the constituent colours of a ColorGroup in the inspector.

2 Likes

This feature will be available in 2023r3, both colors will be shown in the inspector:

In above screenshot:

  • ColorGroup1 is dual
  • ColorGroup2 is a named OS color
  • ColorGroup3 is single
5 Likes

Just to clarify,

What I’m looking for is a way to stipulate say red for light mode and green for dark mode when there is a ColorGroup property in the inspector. Will this achieve this?

You would need to create a colorgroup that has red for light mode and green for dark mode.
Then assign that colorgroup to the control.

1 Like

@GarryPettet that’s how it works already. Once you have a ColorGroup defined, it will just work:

Captura de pantalla 2023-08-31 a las 10.12.42

What this feature request was asking was displaying the preview for light and dark mode directly in the inspector. Current release will just display the light color in the inspector, but it will use the dark one at runtime.

Or do you mean something else?

I think I mean something else (the feedback request was created by someone else - I just added a thumbs up to it).

I have a code editor canvas control that is very customisable. All colours that can be changed are ColorGroups. For example, the BookMarkColor is displayed in the Xojo IDE inspector when you select the control:

In code, I can programatically make BookMarkColor be green in light mode and blue in dark mode like this:

MyControl.BookMarkColor = New ColorGroup(Color.Green, Color.Blue)

What I want is a way to be able in the IDE inspector to select from a color picker green for light mode and blue for dark mode. In my screenshot above you can see that the arrowed BookMarkColor property just shows the normal Color property picker (currently set to blue). This will result in the property always being blue in both light and dark mode.

Essentially, what I think you need to do in the inspector beside ColorGroup properties is not have a popup with a single colour but perhaps two buttons beside each other, one for light and one for dark mode.

Does that make sense?

Humbly disagree. I like the fact that ColorGroups are managed globally for reuse purposes. The whole purpose of the ColorGroup is to not have to set those individual colors every freaking time, not to mention all of the “named colors” where the light and dark variants come from the OS.

I’m a firm “please don’t do this” regarding this idea.

4 Likes

As I’m understanding things now, the feature Garry may be asking for is to improve the workflow so that reusable ColorGroups can be created from the Inspector in that spot.

I do agree that creating one-off property level ColorGroups would be akin to writing HTML inline styles instead of using a style sheet. I think that would make working on a project more difficult.

(@Ricardo_Cruz while ColorGroups have your attention, could you look at #68512 - Allow ColorGroups to be placed in modules for namespacing? Thank you!)

1 Like

I don’t understand this, BookMarkColor is a ColorGroup assigned by code, right? and is displaying Blue because you are in dark mode, no? If you were in Light mode it should show Green, no? Are you saying that your app when run displays Blue in both Light/Dark modes or just the IDE?

So you want to create ColorGroup in code (not using the IDE), then use the IDE to edit the color definition that you created by code? I think I don’t understand.

As there is already a dedicated ColorGroup editor, maybe we can improve the workflow by adding a new option in the PopupMenu “Add new ColorGroup”, that creates a brand new ColorGroup, assigns it to that property and shows the editor.

For editing the current one, a pencil button on the right side of the selector can redirect you directly to that ColorGroup editor.

This should be a new Feature Request in any case.

That’s too far from my comfort zone I’m afraid :upside_down_face:, I was just passing by. I’ll add my thumbs up and bring it to the team.

5 Likes

Thanks for the suggestion @Ricardo_Cruz, I’ll create another feature request I think.

1 Like