Skip to content

Commit e30d102

Browse files
Drew Vogelbrammool
authored andcommitted
patch 8.2.3562: cannot add color names
Problem: Cannot add color names. Solution: Add the v:colornames dictionary. (Drew Vogel, closes #8761)
1 parent 3c5904d commit e30d102

26 files changed

+1364
-398
lines changed

Filelist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -798,6 +798,7 @@ RT_SCRIPTS = \
798798
runtime/autoload/xml/*.vim \
799799
runtime/colors/*.vim \
800800
runtime/colors/README.txt \
801+
runtime/colors/lists/*.vim \
801802
runtime/colors/tools/*.vim \
802803
runtime/compiler/*.vim \
803804
runtime/compiler/README.txt \
@@ -850,7 +851,6 @@ RT_AMI_DOS = \
850851
# DOS runtime (also in the extra archive)
851852
RT_DOS = \
852853
README_dos.txt \
853-
runtime/rgb.txt \
854854
vimtutor.bat \
855855

856856
# DOS runtime without CR-LF translation (also in the extra archive)

READMEdir/README_extra.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ src/os_win32.* Files for the Win32 port.
2626
src/gui_w32.* Files for the Win32 GUI.
2727
src/gui_w48.* Files for the Win32 and Win16 GUI.
2828
src/Make_mvc.mak MS Visual C++ makefile for the Win32 GUI.
29-
runtime/rgb.txt File with color definitions for the Win32 GUI.
3029

3130
src/if_ole.* OLE automation interface, for MS Windows 95 and NT.
3231

nsis/gvim.nsi

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,6 @@ Section "$(str_section_exe)" id_section_exe
357357
File ..\README.txt
358358
File ..\uninstall.txt
359359
File ${VIMRT}\*.vim
360-
File ${VIMRT}\rgb.txt
361360

362361
File ${VIMTOOLS}\diff.exe
363362
File ${VIMTOOLS}\winpty${BIT}.dll
@@ -367,6 +366,8 @@ Section "$(str_section_exe)" id_section_exe
367366
File ${VIMRT}\colors\*.*
368367
SetOutPath $0\colors\tools
369368
File ${VIMRT}\colors\tools\*.*
369+
SetOutPath $0\colors\lists
370+
File ${VIMRT}\colors\lists\*.*
370371

371372
SetOutPath $0\compiler
372373
File ${VIMRT}\compiler\*.*

runtime/colors/README.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,4 +87,5 @@ please check the following items:
8787
- In the GUI, is it easy to find the cursor, also in a file with lots of
8888
syntax highlighting?
8989
- Do not use hard coded escape sequences, these will not work in other
90-
terminals. Always use color names or #RRGGBB for the GUI.
90+
terminals. Always use color names or #RRGGBB for the GUI. See v:colornames
91+
for details on how to define your own color names.

runtime/colors/lists/csscolors.vim

Lines changed: 166 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,166 @@
1+
" Maintainer: Drew Vogel <dvogel@sidejump.org>
2+
" Last Change: 2021 Jul 25
3+
4+
" Similar in spirit to rgb.txt, this plugin establishes a human-friendly name
5+
" for every color listed in the CSS standard:
6+
"
7+
" https://www.w3.org/TR/css-color-3/
8+
9+
let s:keepcpo= &cpo
10+
set cpo&vim
11+
12+
call extend(v:colornames, {
13+
\ 'css_black': '#000000',
14+
\ 'css_silver': '#c0c0c0',
15+
\ 'css_gray': '#808080',
16+
\ 'css_white': '#FFFFFF',
17+
\ 'css_maroon': '#800000',
18+
\ 'css_red': '#FF0000',
19+
\ 'css_purple': '#800080',
20+
\ 'css_fuchsia': '#FF00FF',
21+
\ 'css_green': '#008000',
22+
\ 'css_lime': '#00FF00',
23+
\ 'css_olive': '#808000',
24+
\ 'css_yellow': '#FFFF00',
25+
\ 'css_navy': '#000080',
26+
\ 'css_blue': '#0000FF',
27+
\ 'css_teal': '#008080',
28+
\ 'css_aqua': '#00FFFF',
29+
\
30+
\ 'css_aliceblue': '#f0f8ff',
31+
\ 'css_antiquewhite': '#faebd7',
32+
\ 'css_aquamarine': '#7fffd4',
33+
\ 'css_azure': '#f0ffff',
34+
\ 'css_beige': '#f5f5dc',
35+
\ 'css_bisque': '#ffe4c4',
36+
\ 'css_blanchedalmond': '#ffebcd',
37+
\ 'css_blueviolet': '#8a2be2',
38+
\ 'css_brown': '#a52a2a',
39+
\ 'css_burlywood': '#deb887',
40+
\ 'css_cadetblue': '#5f9ea0',
41+
\ 'css_chartreuse': '#7fff00',
42+
\ 'css_chocolate': '#d2691e',
43+
\ 'css_coral': '#ff7f50',
44+
\ 'css_cornflowerblue': '#6495ed',
45+
\ 'css_cornsilk': '#fff8dc',
46+
\ 'css_crimson': '#dc143c',
47+
\ 'css_cyan': '#00ffff',
48+
\ 'css_darkblue': '#00008b',
49+
\ 'css_darkcyan': '#008b8b',
50+
\ 'css_darkgoldenrod': '#b8860b',
51+
\ 'css_darkgray': '#a9a9a9',
52+
\ 'css_darkgreen': '#006400',
53+
\ 'css_darkgrey': '#a9a9a9',
54+
\ 'css_darkkhaki': '#bdb76b',
55+
\ 'css_darkmagenta': '#8b008b',
56+
\ 'css_darkolivegreen': '#556b2f',
57+
\ 'css_darkorange': '#ff8c00',
58+
\ 'css_darkorchid': '#9932cc',
59+
\ 'css_darkred': '#8b0000',
60+
\ 'css_darksalmon': '#e9967a',
61+
\ 'css_darkseagreen': '#8fbc8f',
62+
\ 'css_darkslateblue': '#483d8b',
63+
\ 'css_darkslategray': '#2f4f4f',
64+
\ 'css_darkslategrey': '#2f4f4f',
65+
\ 'css_darkturquoise': '#00ced1',
66+
\ 'css_darkviolet': '#9400d3',
67+
\ 'css_deeppink': '#ff1493',
68+
\ 'css_deepskyblue': '#00bfff',
69+
\ 'css_dimgray': '#696969',
70+
\ 'css_dimgrey': '#696969',
71+
\ 'css_dodgerblue': '#1e90ff',
72+
\ 'css_firebrick': '#b22222',
73+
\ 'css_floralwhite': '#fffaf0',
74+
\ 'css_forestgreen': '#228b22',
75+
\ 'css_gainsboro': '#dcdcdc',
76+
\ 'css_ghostwhite': '#f8f8ff',
77+
\ 'css_gold': '#ffd700',
78+
\ 'css_goldenrod': '#daa520',
79+
\ 'css_greenyellow': '#adff2f',
80+
\ 'css_grey': '#808080',
81+
\ 'css_honeydew': '#f0fff0',
82+
\ 'css_hotpink': '#ff69b4',
83+
\ 'css_indianred': '#cd5c5c',
84+
\ 'css_indigo': '#4b0082',
85+
\ 'css_ivory': '#fffff0',
86+
\ 'css_khaki': '#f0e68c',
87+
\ 'css_lavender': '#e6e6fa',
88+
\ 'css_lavenderblush': '#fff0f5',
89+
\ 'css_lawngreen': '#7cfc00',
90+
\ 'css_lemonchiffon': '#fffacd',
91+
\ 'css_lightblue': '#add8e6',
92+
\ 'css_lightcoral': '#f08080',
93+
\ 'css_lightcyan': '#e0ffff',
94+
\ 'css_lightgoldenrodyellow': '#fafad2',
95+
\ 'css_lightgray': '#d3d3d3',
96+
\ 'css_lightgreen': '#90ee90',
97+
\ 'css_lightgrey': '#d3d3d3',
98+
\ 'css_lightpink': '#ffb6c1',
99+
\ 'css_lightsalmon': '#ffa07a',
100+
\ 'css_lightseagreen': '#20b2aa',
101+
\ 'css_lightskyblue': '#87cefa',
102+
\ 'css_lightslategray': '#778899',
103+
\ 'css_lightslategrey': '#778899',
104+
\ 'css_lightsteelblue': '#b0c4de',
105+
\ 'css_lightyellow': '#ffffe0',
106+
\ 'css_limegreen': '#32cd32',
107+
\ 'css_linen': '#faf0e6',
108+
\ 'css_magenta': '#ff00ff',
109+
\ 'css_mediumaquamarine': '#66cdaa',
110+
\ 'css_mediumblue': '#0000cd',
111+
\ 'css_mediumorchid': '#ba55d3',
112+
\ 'css_mediumpurple': '#9370db',
113+
\ 'css_mediumseagreen': '#3cb371',
114+
\ 'css_mediumslateblue': '#7b68ee',
115+
\ 'css_mediumspringgreen': '#00fa9a',
116+
\ 'css_mediumturquoise': '#48d1cc',
117+
\ 'css_mediumvioletred': '#c71585',
118+
\ 'css_midnightblue': '#191970',
119+
\ 'css_mintcream': '#f5fffa',
120+
\ 'css_mistyrose': '#ffe4e1',
121+
\ 'css_moccasin': '#ffe4b5',
122+
\ 'css_navajowhite': '#ffdead',
123+
\ 'css_oldlace': '#fdf5e6',
124+
\ 'css_olivedrab': '#6b8e23',
125+
\ 'css_orange': '#ffa500',
126+
\ 'css_orangered': '#ff4500',
127+
\ 'css_orchid': '#da70d6',
128+
\ 'css_palegoldenrod': '#eee8aa',
129+
\ 'css_palegreen': '#98fb98',
130+
\ 'css_paleturquoise': '#afeeee',
131+
\ 'css_palevioletred': '#db7093',
132+
\ 'css_papayawhip': '#ffefd5',
133+
\ 'css_peachpuff': '#ffdab9',
134+
\ 'css_peru': '#cd853f',
135+
\ 'css_pink': '#ffc0cb',
136+
\ 'css_plum': '#dda0dd',
137+
\ 'css_powderblue': '#b0e0e6',
138+
\ 'css_rosybrown': '#bc8f8f',
139+
\ 'css_royalblue': '#4169e1',
140+
\ 'css_saddlebrown': '#8b4513',
141+
\ 'css_salmon': '#fa8072',
142+
\ 'css_sandybrown': '#f4a460',
143+
\ 'css_seagreen': '#2e8b57',
144+
\ 'css_seashell': '#fff5ee',
145+
\ 'css_sienna': '#a0522d',
146+
\ 'css_skyblue': '#87ceeb',
147+
\ 'css_slateblue': '#6a5acd',
148+
\ 'css_slategray': '#708090',
149+
\ 'css_slategrey': '#708090',
150+
\ 'css_snow': '#fffafa',
151+
\ 'css_springgreen': '#00ff7f',
152+
\ 'css_steelblue': '#4682b4',
153+
\ 'css_tan': '#d2b48c',
154+
\ 'css_thistle': '#d8bfd8',
155+
\ 'css_tomato': '#ff6347',
156+
\ 'css_turquoise': '#40e0d0',
157+
\ 'css_violet': '#ee82ee',
158+
\ 'css_wheat': '#f5deb3',
159+
\ 'css_whitesmoke': '#f5f5f5',
160+
\ 'css_yellowgreen': '#9acd32',
161+
\ }, 'keep')
162+
163+
let &cpo= s:keepcpo
164+
unlet s:keepcpo
165+
166+
"vim: sw=4

0 commit comments

Comments
 (0)