Skip to content

Commit 0aa9b87

Browse files
authored
Merge pull request #20 from arzoo14/branch_two
Change RGB colors to symbols in Themes
2 parents 4779d4a + e6ebd88 commit 0aa9b87

2 files changed

Lines changed: 53 additions & 36 deletions

File tree

lib/rubyplot/color.rb

Lines changed: 39 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,43 @@
11
module Rubyplot
22
module Color
33
# A list of contrasting colors that is used in Bartype BasePlots by default
4-
CONTRASTING_COLORS =
5-
[
6-
'#e6194b',
7-
'#3cb44b',
8-
'#ffe119',
9-
'#0082c8',
10-
'#f58231',
11-
'#911eb4',
12-
'#46f0f0',
13-
'#f032e6',
14-
'#d2f53c',
15-
'#fabebe',
16-
'#008080',
17-
'#e6beff',
18-
'#aa6e28',
19-
'#fffac8',
20-
'#800000',
21-
'#aaffc3',
22-
'#808000',
23-
'#ffd8b1',
24-
'#000080',
25-
'#808080'
26-
].freeze
4+
CONTRASTING_COLORS = {
5+
gun_powder: '#4a465a',
6+
eastern_blue: '#0083a3',
7+
bittersweet: '#ff6a6a',
8+
light_pink: '#ffaeb9',
9+
violet: '#ee82ee',
10+
bright_turquoise: '#00e5ee',
11+
spring_green: '#00ff7f',
12+
green_yellow: '#c0ff3e',
13+
orange: '#ffa500',
14+
misty_rose: '#ffe4e1',
15+
silver: '#bdbdbd',
16+
falu_red: '#8b2500',
17+
royal_blue: '#436eee',
18+
crimson: '#dc143c',
19+
crimson: '#e6194b',
20+
fruit_salad: '#3cb44b',
21+
lemon: '#ffe119',
22+
bondi_blue: '#0082c8',
23+
sun: '#f58231',
24+
dark_orchid: '#911eb4',
25+
turquoise: '#46f0f0',
26+
razzle_dazzle_rose: '#f032e6',
27+
pear: '#d2f53c',
28+
your_pink: '#fabebe',
29+
teal: '#008080',
30+
mauve: '#e6beff',
31+
hot_toddy: '#aa6e28',
32+
lemon_chiffon: '#fffac8',
33+
maroon: '#800000',
34+
magic_mint: '#aaffc3',
35+
olive: '#808000',
36+
sandy_beach: '#ffd8b1',
37+
navy: '#000080',
38+
grey: '#808080',
39+
pattens_blue: '#d1edf5'
40+
}.freeze
2741

2842
# A list of color symbols inspired by xkcd survey
2943
# https://xkcd.com/color/rgb/
@@ -972,7 +986,8 @@ module Color
972986
blue: '#0000FF',
973987
green: '#008000',
974988
purple: '#7e1e9c',
975-
vivid_orange: '#ff7f0e',
989+
vivid_orange: '#ff7f0e'
990+
976991
}.freeze
977992
end
978993
end

lib/rubyplot/themes.rb

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,40 +6,42 @@ module Themes
66
BASIC = {
77
marker_color: 'white', # The color of the marker used to make marker lines on plot.
88
font_color: 'white', # Font Color used to write on the plot.
9-
background_colors: %w[black #4a465a], # The Background colors that form the gradient
10-
label_colors: %w[#ffe119 #0082c8 #f58231 #911eb4 #aaffc3 #808000 #ffd8b1 #000080 #808080]
9+
background_colors: %I[black gun_powder], # The Background colors that form the gradient
10+
label_colors: %I[lemon bondi_blue sun dark_orchid magic_mint olive sandy_beach navy grey]
1111
}.freeze
1212

1313
TRACKS = {
1414
marker_color: 'white',
1515
font_color: 'white',
16-
background_colors: %w[#0083a3 #0083a3],
17-
label_colors: %w[yellow green blue red maroon grey \
18-
#FF6A6A #FFAEB9 #EE82EE #00E5EE #00FF7F #C0FF3E #FFA500 #FFE4E1\
19-
#BDBDBD #8B2500 #436EEE #DC143C]
16+
background_colors: %I[eastern_blue eastern_blue],
17+
label_colors: %I[yellow green blue red maroon grey \
18+
bittersweet light_pink violet bright_turquoise spring_green green_yellow orange misty_rose\
19+
silver falu_red royal_blue crimson]
2020

2121
}.freeze
2222

2323
OREO = {
2424
marker_color: 'white',
2525
font_color: 'white',
26-
background_colors: %w[#0083a3 #0083a3],
27-
label_colors: %w[#e6194b #3cb44b #ffe119 #0082c8 #f58231 #911eb4 #008080 #e6beff #aa6e28]
26+
background_colors: %I[eastern_blue eastern_blue],
27+
label_colors: %I[crimson fruit_salad lemon bondi_blue sun dark_orchid teal mauve hot_toddy]
2828
}.freeze
2929

3030
RITA = {
3131
marker_color: 'black',
3232
font_color: 'black',
33-
background_colors: %w[#d1edf5 white],
34-
label_colors: %w[#46f0f0 #f032e6 #d2f53c #fabebe #008080 #e6beff #aa6e28 #fffac8 #800000]
33+
background_colors: %I[pattens_blue white],
34+
label_colors: %I[turquoise razzle_dazzle_rose pear your_pink teal mauve hot_toddy lemon_chiffon maroon]
3535
}.freeze
3636

3737
# Plain White back ground with no gradient.
3838
CLASSIC_WHITE = {
3939
marker_color: 'black',
4040
font_color: 'black',
41-
background_colors: %w[white white],
42-
label_colors: %I[strong_blue vivid_orange dark_lime_green strong_red slightly_desaturated_violet dark_grey strong_yellow strong_cyan yellow maroon grey]
41+
background_colors: %I[white white],
42+
label_colors: %I[strong_blue vivid_orange dark_lime_green strong_red slightly_desaturated_violet \
43+
dark_grey strong_yellow strong_cyan yellow maroon grey]
44+
4345
}.freeze
4446
end
4547
end

0 commit comments

Comments
 (0)