/
rocky-trepanx-colors.rb
46 lines (44 loc) · 1.42 KB
/
rocky-trepanx-colors.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# Terminal color settings I use. I doubt terminal colors are
# standardized let alone what colors you want for the various
# syntax elements. So you should adjust as desired.
# Values are either a number string, e.g. '36' or a pair of number
# semicolon and number, e.g. '3;36'.
#
# The first number before a semicolon is a font modifier from the
# following table:
#
# 1 - bold
# 3 - italic
# 4 - underline
require 'rubygems'
require 'coderay'
TERM_TOKEN_COLORS = {
:comment => '3;37', # sienna #8b4726
:constant => '1;34', # Bold Midnight Blue #191970
:class => '1;2', #
:doctype => '1;2', #
:global_variable => '36', # yellow brownish
:integer => '29', # black #00000
:label => '4', # black underline
:method => '34', # blue #0000FF
:pre_constant => '3;33', # goldenrod4 #8b6914
:regexp => {
:content => '36', # dark cyan #008b8b
:delimiter => '1;29', # bold black
:modifier => '35',
:function => '1;29'
},
:string => {
:content => '1;37', # ivory4 (grey) #8b8b83
:delimiter => '1;29', # bold black
},
:reserved => '1;32', # bold dark olive green #556b2f RGB: 85, 107, 47
:symbol => '35', # purple4 #551A8B RGB: 85, 26, 139
}
module CodeRay::Encoders
class Terminal < Encoder
TERM_TOKEN_COLORS.each_pair do |key, value|
TOKEN_COLORS[key] = value
end
end
end