Xresources doesn't have orange, hard black and grays
anarcat opened this issue · comments
I found myself converting my i3 config to use colors from my .Xresources (https://i3wm.org/docs/userguide.html#xresources) to avoid copying stuff all over the place, and noticed that the follow colors are missing from the Xresources
file:
set $orange #D75F00
set $bright_orange #FF8700
set $xgray1 #262626
set $xgray2 #303030
set $xgray3 #3A3A3A
set $xgray4 #444444
set $xgray5 #4E4E4E
set $hard_black #121212
looking at the .Xresources
file, we see it only defines the "basic" 16 colors supported by every terminal. the README file also says:
Additionally Srcery uses some xterm 256 colors to pad out the color selection, no extra configuration needed.
... yet it's unclear how that works to me in the first place: is srcery just assuming those are the colors used by xterm? shouldn't we provide those colors in the Xresources for other applications to use?
i know this is not good enough of a fix (because i'd need to fix the Xresources generator, not the generated file), but here's what I'm testing with right now:
@@ -34,3 +34,18 @@
! white
*.color7: #baa67f
*.color15: #fce8c3
+
+! those are beyond the base 16-colors set
+! orange
+*.color202: #FF5F00
+*.color208: #FF8700
+
+! hard black
+*.color233: #121212
+
+! grays
+*.color235: #262626
+*.color236: #303030
+*.color237: #3A3A3A
+*.color238: #444444
+*.color239: #4E4E4E
Hi @anarcat thanks for opening an issue. The reason those aren't defined is because they are already included in the in the default xterm 256 colorscheme, they are unchanged. The reason for this is for compatibility and to have a bit of a wider color selection. You can just refer to the color you need, you don't need to change it.
Yeah, I suppose we are assuming that those colors remain unchanged, but when I first made srcery, I didn't want to overcomlicate things by having an install script etc. So I just went for the default colors, with the assumption that they are indeed the default colors.
For reference heres my i3 config
# define palette
set_from_resource $black i3wm.color0 #1C1B19
set_from_resource $bright_black i3wm.color8 #918175
set_from_resource $red i3wm.color1 #FF3128
set_from_resource $bright_red i3wm.color9 #DA4939
set_from_resource $green i3wm.color2 #519F50
set_from_resource $bright_green i3wm.color10 #98BC37
set_from_resource $yellow i3wm.color3 #FBB829
set_from_resource $bright_yellow i3wm.color11 #FFC66D
set_from_resource $blue i3wm.color4 #5573A3
set_from_resource $bright_blue i3wm.color12 #6D9CBE
set_from_resource $magenta i3wm.color5 #E02C6D
set_from_resource $bright_magenta i3wm.color13 #E35682
set_from_resource $cyan i3wm.color6 #1693A5
set_from_resource $bright_cyan i3wm.color14 #34BEDA
set_from_resource $white i3wm.color7 #D0BFA1
set_from_resource $bright_white i3wm.color15 #FCE8C3
set_from_resource $orange i3wm.color166 #D75F00
set_from_resource $bright_orange i3wm.color208 #FF8700
set_from_resource $hard_black i3wm.color232 #080808
set_from_resource $xgray1 i3wm.color235 #262626
set_from_resource $xgray2 i3wm.color236 #303030
set_from_resource $xgray3 i3wm.color237 #3A3A3A
set_from_resource $xgray4 i3wm.color238 #444444
set_from_resource $xgray5 i3wm.color239 #4E4E4E
For reference heres my i3 config
those are strangely different from the one in https://github.com/srcery-colors/srcery-gui/blob/master/i3wm/i3-config and not just because it uses set_from_resources
, the actual colors are different!
for example. you define:
set_from_resource $red i3wm.color1 #FF3128
set_from_resource $bright_red i3wm.color9 #DA4939
... while the latter defines:
set $red #EF2F27
set $bright_red #F75341
am i missing something?
Yeah, I suppose we are assuming that those colors remain unchanged, but when I first made srcery, I didn't want to overcomlicate things by having an install script etc. So I just went for the default colors, with the assumption that they are indeed the default colors.
i guess that makes sense, but now i find myself in a situation (specifically with i3) where I don't want to duplicate colors between projects, and want to reuse the colors from the Xresources, so I wonder if that shouldn't be added there anyways. (not that i could make set_from_resources
work in the first place though, see i3/i3#5051)
You can still use xresources as your default, and not having to redefine anything, like I do (or at least I thought I did) The colors are likely different because I maintain a separate config from the one tracked on gui, and I guess I should look into updating the palette :)
EDIT: heres my config, in case you wanna check that out. Its built using a home made templating system due to having to use the config on various systems, but it might be something useful in there, haven't messed with it in a while.
Setting the colors above 16 in xresources in non-trivial IIRC, and requires more setup than its worth. It's a pretty safe assumption that those colors are the ones defined in https://en.wikipedia.org/wiki/Xterm#/media/File:Xterm_256color_chart.svg and remain unchanged.
If that isn't the case, and those colors are changed, then that is a config issue, not really something I can address.