rose-pine / xresources

Soho vibes for Xresources
5 stars 1 forks source link

Ideas to use the whole palette #2

Open frno7 opened 1 year ago

frno7 commented 1 year ago

The current X resource files repeat some colours, while missing some others. Here are some suggestions to make full use of the whole 15 colour palette, for all theme variants. I've made some minor reordering for a better fit with ANSI colours. For example, gold is mapped to ANSI yellow (color3, corresponding to ANSI codes 33 and 43). For Rosé Pine Dawn, surface and text are swapped to match the ANSI ordering of the black and white colours.

Rosé Pine

#define base        #191724
#define surface     #1f1d2e
#define overlay     #26233a
#define muted       #6e6a86
#define subtle      #908caa
#define text        #e0def4
#define love        #eb6f92
#define gold        #f6c177
#define rose        #ebbcba
#define pine        #31748f
#define foam        #9ccfd8
#define iris        #c4a7e7
#define highlight_low   #21202e
#define highlight_med   #403d52
#define highlight_high  #524f67

*.foreground:       text
*.background:       surface
*.cursorColor:      highlight_high

*.color0:       surface
*.color1:       love
*.color2:       rose
*.color3:       gold
*.color4:       pine
*.color5:       iris
*.color6:       foam
*.color7:       text
*.color8:       base
*.color9:       overlay
*.color10:      muted
*.color11:      subtle
*.color12:      highlight_low
*.color13:      highlight_med
*.color14:      highlight_high
*.color15:      #ffffff

Rosé Pine Moon

#define base        #232136
#define surface     #2a273f
#define overlay     #393552
#define muted       #6e6a86
#define subtle      #908caa
#define text        #e0def4
#define love        #eb6f92
#define gold        #f6c177
#define rose        #ea9a97
#define pine        #3e8fb0
#define foam        #9ccfd8
#define iris        #c4a7e7
#define highlight_low   #2a283e
#define highlight_med   #44415a
#define highlight_high  #56526e

*.foreground:       text
*.background:       surface
*.cursorColor:      highlight_high

*.color0:       surface
*.color1:       love
*.color2:       rose
*.color3:       gold
*.color4:       pine
*.color5:       iris
*.color6:       foam
*.color7:       text
*.color8:       base
*.color9:       overlay
*.color10:      muted
*.color11:      subtle
*.color12:      highlight_low
*.color13:      highlight_med
*.color14:      highlight_high
*.color15:      #ffffff

Rosé Pine Dawn

#define base        #faf4ed
#define surface     #fffaf3
#define overlay     #f2e9e1
#define muted       #9893a5
#define subtle      #797593
#define text        #575279
#define love        #b4637a
#define gold        #ea9d34
#define rose        #d7827e
#define pine        #286983
#define foam        #56949f
#define iris        #907aa9
#define highlight_low   #f4ede8
#define highlight_med   #dfdad9
#define highlight_high  #cecacd

*.foreground:       text
*.background:       surface
*.cursorColor:      highlight_high

*.color0:       text
*.color1:       love
*.color2:       rose
*.color3:       gold
*.color4:       pine
*.color5:       iris
*.color6:       foam
*.color7:       surface
*.color8:       base
*.color9:       overlay
*.color10:      muted
*.color11:      subtle
*.color12:      highlight_low
*.color13:      highlight_med
*.color14:      highlight_high
*.color15:      #ffffff
harishnkr commented 1 year ago

I understand the idea, but can you check how the implementation would affect different apps? For example if you see a Neofetch output, the colours and their lighter variants are shown top to bottom. So it would be helpful to know how much of an impact it makes on various applications. There are various other rose pine templates which do not use all the colours so personally I would like to know how much of it will help. Maybe some screenshots of the applications that you use would help, which uses all or most of the 15 colours, where the colour definitions are the default definitions?

Let me check the colour matching with ANSI colours issue , I'm not on my pc atm. If you don't mind, create a separate pull request for the ANSI ordering issue, I'll be happy to merge :)

frno7 commented 1 year ago

Maybe some screenshots of the applications that you use would help, which uses all or most of the 15 colours, where the colour definitions are the default definitions?

Here’s the thing: although these Rosé Pine X resources define a palette, some of the most important X terminal apps, such Neovim (with rose-pine/neovim), ignore the terminal palette and redefine their own palette anyway. This may be a slight inconvenience with a 256 colour (or even true colour) capable terminal, but it doesn’t work with the Rosé Pine Linux tty which only has the 8 + 16 (background + foreground) palette to work with.

The idea is that, instead, Neovim (or some other app) can make full use of the complete and preexisting X (or Linux tty) palette, as opposed to having it override the X (or fail to override the tty) palette. Switching (main/moon/dawn) themes becomes simpler too, because only the X (or tty) palette needs to change, not X plus every individual app.

Anyhow, I think that’s a more effective approach to managing a palette. Feel free to close the issue. :)

Let me check the colour matching with ANSI colours issue , I'm not on my pc atm. If you don't mind, create a separate pull request for the ANSI ordering issue, I'll be happy to merge :)

Also notice that surface is made background, according to the theme specification, as either color0 (for main or moon) or color7 (for dawn), as opposed to base (which is reordered to color8, the ‘bright’ variant of color0 according to ANSI). This rearrangement is perhaps most noticeable with dawn, since surface is significantly brighter than base.

harishnkr commented 1 year ago

To be fair, terminal apps use the terminal colour scheme unless specified. If you use a terminal emulator that gets it's colors from x resources, then it applies to all terminal apps. For eg, I use a modified st terminal which gets it's colours from xresources.

You can make neovim use the Xresources colours if you comment out the line that uses another colourscheme in the config file. But it only works if the terminal emulator or the shell(unless specified) uses Xresources.

I honestly don't want to close the issue if it can be worked out somehow. I have initially tried using the whole palette in Xresources but I couldn't figure it out without losing any visual appeal. I'll keep the issue open for a while in anyone can improve on the idea.

As for the second issue, I'll check it out in a while.

Thanks anyway :)

frno7 commented 1 year ago

To be fair, terminal apps use the terminal colour scheme unless specified. If you use a terminal emulator that gets it's colors from x resources, then it applies to all terminal apps. For eg, I use a modified st terminal which gets it's colours from xresources.

Yeah, but one still has to make sure that Neovim’s palette index mapping is correct. For example, if syntax highlighted strings (in accordance with the Rosé Pine specification) are supposed to be gold, Neovim needs to be told that gold is mapped to color3 (or whatever the terminal’s mapping is).

The flexible part in all this however is that Neovim doesn’t need to know the actual RGB values for gold, it only needs to know the palette index (color0 through color15), because gold stays on color3 regardless of the chosen theme variant (main, moon, or dawn). As far as I understand, this is the only way to make Neovim work properly with the Rosé Pine Linux tty.

Admittedly, things are still a bit fiddly... For instance, I’ve just noticed that man pages are displayed with an unfortunate choice of colours, so man needs to be remapped (or the 15 colour palette indices need reordering).

I honestly don't want to close the issue if it can be worked out somehow. I have initially tried using the whole palette in Xresources but I couldn't figure it out without losing any visual appeal.

The Solarized theme has essentially the same issues, because it defines a full 16 colour palette. Similar to what I attempt to do with Rosé Pine, Solarized maps various shades to color10, color11, color12 and color14.

I'll keep the issue open for a while in anyone can improve on the idea.

Maybe one can supply two X resource variants? The current limited 10 colour palette in files named

and then an alternative full 15 colour palette in files named

(Something needs to be decided for the remaining 16th colour.)

Thanks anyway :)

Cheers. :D

harishnkr commented 1 year ago

Since the colours problem is a bit of a headache, it would be good if this particular setup is utilised more of as a template. Once it's used, it's better if reordering is done based on one's own taste. Also let me see if there requires 2 separate palette.