Darkmode Colors

Does anyone have a chart that shows standard colors for light mode, and what the corresponding dark-mode should be?

a conversion ALGORITHM would be even better!

I realize some “system” things change automagically, but things that are colored explictily arent’

a lot of dark mode colors arent solid colors
they are colors with various levels of alpha applied
so the net effect when you apply one over something else is a blend

I’d

  • buy or use some code from someone who has already done the declares into the semantic colors
  • use a plugin and save yourself the time
  • write the ton of declares required

And I would use the semantic colors as this should be a strong hint there may be more “theming” capabilities coming

My 2 cents from having done this once or twice

[quote=440380:@Norman Palardy]buy or use some code from someone who has already done the declares into the semantic colors
use a plugin and save yourself the time
write the ton of declares required[/quote]

And who might that be? I’d love to have a plugin to handle it!

MBS has a plugin (who else ?)

NSColorMBS

Just be aware that IF you have to support older OSes that some of the new colors do not have equivalents on older macOS versions so you may have to use a try catch or something else to deal with the fact Apple has changed a ton between 10.13 and 10.14 as far as semantic colors goes

this is true whether you use a plugin or a declare based solution

1 Like

My Beacon project has code for handling dark mode colors pretty accurately. You can’t perfectly represent an NSColor with Xojo’s Color type for a number of reason, but my SystemColors module comes about as close as you can get with Xojo. It’s not a very nice module though, so I’d recommend using it more for inspiration than anything else.

https://github.com/thommcgrath/Beacon/blob/master/Project/Modules/SystemColors.xojo_code

Thanks Thom… I found some nuggets that might prove usefull…

I was surprised that there was no code to handle

  • Cyan
  • darkGray
  • lightGray
  • Magenta
  • Teal

but all the other “rainbow” named colors were there (barring black and white)

[quote=440401:@Dave S]Thanks Thom… I found some nuggets that might prove usefull…

I was surprised that there was no code to handle

  • Cyan
  • darkGray
  • lightGray
  • Magenta
  • Teal

but all the other “rainbow” named colors were there (barring black and white)[/quote]
Yeah but there are ways around that. I use one of the 4 label colors depending on the darkness I need. But I’ve got all sorts of color manipulation code. What I use on the website takes the desired foreground color, the destination background color, and adjusts the color just enough to meet contrast usability standards. I could port that to Xojo if there is interest.