v0.5.1 657f658

colors.go RawHistoryFolder

1package css
2
3import "strconv"
4
5// CSS named colors (CSS Color 3 + rebeccapurple).
6var namedColors = func() map[string]Color {
7	m := map[string]Color{}
8	for name, hex := range map[string]string{
9		"black":                "#000000",
10		"silver":               "#c0c0c0",
11		"gray":                 "#808080",
12		"white":                "#FFFFFF",
13		"maroon":               "#800000",
14		"red":                  "#FF0000",
15		"purple":               "#800080",
16		"fuchsia":              "#FF00FF",
17		"green":                "#008000",
18		"lime":                 "#00FF00",
19		"olive":                "#808000",
20		"yellow":               "#FFFF00",
21		"navy":                 "#000080",
22		"blue":                 "#0000FF",
23		"teal":                 "#008080",
24		"aqua":                 "#00FFFF",
25		"aliceblue":            "#f0f8ff",
26		"antiquewhite":         "#faebd7",
27		"aquamarine":           "#7fffd4",
28		"azure":                "#f0ffff",
29		"beige":                "#f5f5dc",
30		"bisque":               "#ffe4c4",
31		"blanchedalmond":       "#ffebcd",
32		"blueviolet":           "#8a2be2",
33		"brown":                "#a52a2a",
34		"burlywood":            "#deb887",
35		"cadetblue":            "#5f9ea0",
36		"chartreuse":           "#7fff00",
37		"chocolate":            "#d2691e",
38		"coral":                "#ff7f50",
39		"cornflowerblue":       "#6495ed",
40		"cornsilk":             "#fff8dc",
41		"crimson":              "#dc143c",
42		"cyan":                 "#00ffff",
43		"darkblue":             "#00008b",
44		"darkcyan":             "#008b8b",
45		"darkgoldenrod":        "#b8860b",
46		"darkgray":             "#a9a9a9",
47		"darkgreen":            "#006400",
48		"darkgrey":             "#a9a9a9",
49		"darkkhaki":            "#bdb76b",
50		"darkmagenta":          "#8b008b",
51		"darkolivegreen":       "#556b2f",
52		"darkorange":           "#ff8c00",
53		"darkorchid":           "#9932cc",
54		"darkred":              "#8b0000",
55		"darksalmon":           "#e9967a",
56		"darkseagreen":         "#8fbc8f",
57		"darkslateblue":        "#483d8b",
58		"darkslategray":        "#2f4f4f",
59		"darkslategrey":        "#2f4f4f",
60		"darkturquoise":        "#00ced1",
61		"darkviolet":           "#9400d3",
62		"deeppink":             "#ff1493",
63		"deepskyblue":          "#00bfff",
64		"dimgray":              "#696969",
65		"dimgrey":              "#696969",
66		"dodgerblue":           "#1e90ff",
67		"firebrick":            "#b22222",
68		"floralwhite":          "#fffaf0",
69		"forestgreen":          "#228b22",
70		"gainsboro":            "#dcdcdc",
71		"ghostwhite":           "#f8f8ff",
72		"gold":                 "#ffd700",
73		"goldenrod":            "#daa520",
74		"greenyellow":          "#adff2f",
75		"grey":                 "#808080",
76		"honeydew":             "#f0fff0",
77		"hotpink":              "#ff69b4",
78		"indianred":            "#cd5c5c",
79		"indigo":               "#4b0082",
80		"ivory":                "#fffff0",
81		"khaki":                "#f0e68c",
82		"lavender":             "#e6e6fa",
83		"lavenderblush":        "#fff0f5",
84		"lawngreen":            "#7cfc00",
85		"lemonchiffon":         "#fffacd",
86		"lightblue":            "#add8e6",
87		"lightcoral":           "#f08080",
88		"lightcyan":            "#e0ffff",
89		"lightgoldenrodyellow": "#fafad2",
90		"lightgray":            "#d3d3d3",
91		"lightgreen":           "#90ee90",
92		"lightgrey":            "#d3d3d3",
93		"lightpink":            "#ffb6c1",
94		"lightsalmon":          "#ffa07a",
95		"lightseagreen":        "#20b2aa",
96		"lightskyblue":         "#87cefa",
97		"lightslategray":       "#778899",
98		"lightslategrey":       "#778899",
99		"lightsteelblue":       "#b0c4de",
100		"lightyellow":          "#ffffe0",
101		"limegreen":            "#32cd32",
102		"linen":                "#faf0e6",
103		"magenta":              "#ff00ff",
104		"mediumaquamarine":     "#66cdaa",
105		"mediumblue":           "#0000cd",
106		"mediumorchid":         "#ba55d3",
107		"mediumpurple":         "#9370db",
108		"mediumseagreen":       "#3cb371",
109		"mediumslateblue":      "#7b68ee",
110		"mediumspringgreen":    "#00fa9a",
111		"mediumturquoise":      "#48d1cc",
112		"mediumvioletred":      "#c71585",
113		"midnightblue":         "#191970",
114		"mintcream":            "#f5fffa",
115		"mistyrose":            "#ffe4e1",
116		"moccasin":             "#ffe4b5",
117		"navajowhite":          "#ffdead",
118		"oldlace":              "#fdf5e6",
119		"olivedrab":            "#6b8e23",
120		"orange":               "#ffa500",
121		"orangered":            "#ff4500",
122		"orchid":               "#da70d6",
123		"palegoldenrod":        "#eee8aa",
124		"palegreen":            "#98fb98",
125		"paleturquoise":        "#afeeee",
126		"palevioletred":        "#db7093",
127		"papayawhip":           "#ffefd5",
128		"peachpuff":            "#ffdab9",
129		"peru":                 "#cd853f",
130		"pink":                 "#ffc0cb",
131		"plum":                 "#dda0dd",
132		"powderblue":           "#b0e0e6",
133		"rosybrown":            "#bc8f8f",
134		"royalblue":            "#4169e1",
135		"saddlebrown":          "#8b4513",
136		"salmon":               "#fa8072",
137		"sandybrown":           "#f4a460",
138		"seagreen":             "#2e8b57",
139		"seashell":             "#fff5ee",
140		"sienna":               "#a0522d",
141		"skyblue":              "#87ceeb",
142		"slateblue":            "#6a5acd",
143		"slategray":            "#708090",
144		"slategrey":            "#708090",
145		"snow":                 "#fffafa",
146		"springgreen":          "#00ff7f",
147		"steelblue":            "#4682b4",
148		"tan":                  "#d2b48c",
149		"thistle":              "#d8bfd8",
150		"tomato":               "#ff6347",
151		"turquoise":            "#40e0d0",
152		"violet":               "#ee82ee",
153		"wheat":                "#f5deb3",
154		"whitesmoke":           "#f5f5f5",
155		"yellowgreen":          "#9acd32",
156		"rebeccapurple":        "#663399",
157	} {
158		m[name] = hexColor(hex)
159	}
160	return m
161}()
162
163func hexColor(hex string) Color {
164	var v [3]uint64
165	for i := range v {
166		v[i], _ = strconv.ParseUint(hex[1+i*2:3+i*2], 16, 8)
167	}
168	return Color{float64(v[0]) / 255, float64(v[1]) / 255, float64(v[2]) / 255, 1}
169}

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 1

Tags 12

↑↓ moveenter openesc close