Zeal-Operating-System / ZealOS

The Zeal Operating System is a modernized fork of the 64-bit Temple Operating System, TempleOS.
https://zealos.net
The Unlicense
1.42k stars 68 forks source link

How to do theming properly? #118

Closed SolsticeSpectrum closed 1 year ago

SolsticeSpectrum commented 1 year ago

I found this folder: https://github.com/Zeal-Operating-System/ZealOS/tree/b32f9cea7788a04012ea50b5cd501ba36746862e/src/Home/PaletteEditor/Palettes

And I assume this could be used to add own palettes which then can be used to change the colors of the system. What is the proper way of doing this? The regular way in vanilla TempleOS is creating some sort of Theme.HC file and then including it in HomeSys. I assume ZealOS has better way?

Sorry I am a noob when it comes to TempleOS, this was how I applied themes in regular TempleOS

public CBGR48 gr_palette_nord[COLORS_NUM]={
  0xd8d8dedee9e9, // BLACK
  0x8181a1a1c1c1, // BLUE
  0xa3a3bebe8c8c, // GREEN
  0x8888c0c0d0d0, // CYAN
  0xbfbf61616a6a, // RED
  0xb4b48e8eadad, // PURPLE
  0xd0d087877070, // BROWN
  0x4c4c56566a6a, // LTGRAY
  0x3b3b42425252, // DKGRAY
  0x8181a1a1c1c1, // LTBLUE
  0xa3a3bebe8c8c, // LTGREEN
  0x8f8fbcbcbbbb, // LTCYAN
  0xbfbf61616a6a, // LTRED
  0xb4b48e8eadad, // LTPURPLE
  0xebebcbcb8b8b, // YELLOW
  0x2e2e34344040  // WHITE
};

GrPaletteSet(gr_palette_nord);
MemCpy(gr_palette_std, gr_palette_nord, sizeof(gr_palette_nord));

ZealOS also uses 6 character hex codes for colors instead of 12

GutPuncher commented 1 year ago

There are two main ways palettes are added in Zeal. Traditionally, new palettes get added to GrPalette.ZC and are available system-wide.

Recently, y4my4m did great work to create a fun PaletteEditor program currently in the /Home/PaletteEditor folder that you can use to make new palettes interactively. However, these do not save to GrPalette.ZC, and instead become separate files within the PaletteEditor directory structure. The PaletteEditor is still technically a work-in-progress, so its functionality isn't final.

There isn't a specific place that one should put the call to the palette method to set the user preferred palette on boot, generally each user modifies their personal system in the way that suits their preferences best. I personally put #include "C:/Home/PaletteEditor/Palettes/Amicus.ZC";;PaletteSetAmicus; at the bottom of my /Home/HomeSys.ZC.

Eventually these two ways of introducing palettes may be changed to a different system, but this is currently the state of adding palettes in Zeal.