From 508ea9e8325e5bc32dc2fb029fbad8e8cf651c7d Mon Sep 17 00:00:00 2001 From: arzoo14 Date: Tue, 18 Dec 2018 23:06:56 +0530 Subject: [PATCH] rgb_colors --- lib/rubyplot/color.rb | 70 +++++++++++++++++++++++++++--------------- lib/rubyplot/themes.rb | 26 ++++++++-------- 2 files changed, 58 insertions(+), 38 deletions(-) diff --git a/lib/rubyplot/color.rb b/lib/rubyplot/color.rb index 0d42219..0d4c8a6 100644 --- a/lib/rubyplot/color.rb +++ b/lib/rubyplot/color.rb @@ -1,29 +1,43 @@ module Rubyplot module Color # A list of contrasting colors that is used in Bartype BasePlots by default - CONTRASTING_COLORS = - [ - '#e6194b', - '#3cb44b', - '#ffe119', - '#0082c8', - '#f58231', - '#911eb4', - '#46f0f0', - '#f032e6', - '#d2f53c', - '#fabebe', - '#008080', - '#e6beff', - '#aa6e28', - '#fffac8', - '#800000', - '#aaffc3', - '#808000', - '#ffd8b1', - '#000080', - '#808080' - ].freeze + CONTRASTING_COLORS = { + gun_powder: '#4a465a', + eastern_blue: '#0083a3', + bittersweet: '#ff6a6a', + light_pink: '#ffaeb9', + violet: '#ee82ee', + bright_turquoise: '#00e5ee', + spring_green: '#00ff7f', + green_yellow: '#c0ff3e', + orange: '#ffa500', + misty_rose: '#ffe4e1', + silver: '#bdbdbd', + falu_red: '#8b2500', + royal_blue: '#436eee', + crimson: '#dc143c', + crimson: '#e6194b', + fruit_salad: '#3cb44b', + lemon: '#ffe119', + bondi_blue: '#0082c8', + sun: '#f58231', + dark_orchid: '#911eb4', + turquoise: '#46f0f0', + razzle_dazzle_rose: '#f032e6', + pear: '#d2f53c', + your_pink: '#fabebe', + teal: '#008080', + mauve: '#e6beff', + hot_toddy: '#aa6e28', + lemon_chiffon: '#fffac8', + maroon: '#800000', + magic_mint: '#aaffc3', + olive: '#808000', + sandy_beach: '#ffd8b1', + navy: '#000080', + grey: '#808080', + pattens_blue: '#d1edf5' + }.freeze # A list of color symbols inspired by xkcd survey # https://xkcd.com/color/rgb/ @@ -624,7 +638,8 @@ module Color lemon_yellow: '#fdff38', pistachio: '#c0fa8b', dull_yellow: '#eedc5b', - dark_lime_green: '#7ebd01', + strong_green: '#7ebd01', + dark_lime_green: '#2ca02c', denim_blue: '#3b5b92', teal_blue: '#01889f', lightish_blue: '#3d7afd', @@ -756,6 +771,9 @@ module Color dark_beige: '#ac9362', emerald: '#01a049', pale_red: '#d9544d', + strong_red: '#d62728', + strong_cyan: '#d62728', + strong_yellow: '#bcbd22', light_magenta: '#fa5ff7', sky: '#82cafc', light_cyan: '#acfffc', @@ -879,6 +897,7 @@ module Color goldenrod: '#fac205', dark_yellow: '#d5b60a', dark_grey: '#363737', + slightly_desaturated_violet: '#9467bd', army_green: '#4b5d16', grey_blue: '#6b8ba4', seafoam: '#80f9ad', @@ -966,7 +985,8 @@ module Color pink: '#ff81c0', blue: '#0000FF', green: '#008000', - purple: '#7e1e9c' + purple: '#7e1e9c', + vivid_orange: '#ff7f0e' }.freeze end end diff --git a/lib/rubyplot/themes.rb b/lib/rubyplot/themes.rb index 606a9e5..5696215 100644 --- a/lib/rubyplot/themes.rb +++ b/lib/rubyplot/themes.rb @@ -6,41 +6,41 @@ module Themes BASIC = { marker_color: 'white', # The color of the marker used to make marker lines on plot. font_color: 'white', # Font Color used to write on the plot. - background_colors: %w[black #4a465a], # The Background colors that form the gradient - label_colors: %w[#ffe119 #0082c8 #f58231 #911eb4 #aaffc3 #808000 #ffd8b1 #000080 #808080] + background_colors: %I[black gun_powder], # The Background colors that form the gradient + label_colors: %I[lemon bondi_blue sun dark_orchid magic_mint olive sandy_beach navy grey] }.freeze TRACKS = { marker_color: 'white', font_color: 'white', - background_colors: %w[#0083a3 #0083a3], - label_colors: %w[yellow green blue red maroon grey \ -#FF6A6A #FFAEB9 #EE82EE #00E5EE #00FF7F #C0FF3E #FFA500 #FFE4E1\ -#BDBDBD #8B2500 #436EEE #DC143C] + background_colors: %I[eastern_blue eastern_blue], + label_colors: %I[yellow green blue red maroon grey \ +bittersweet light_pink violet bright_turquoise spring_green green_yellow orange misty_rose\ +silver falu_red royal_blue crimson] }.freeze OREO = { marker_color: 'white', font_color: 'white', - background_colors: %w[#0083a3 #0083a3], - label_colors: %w[#e6194b #3cb44b #ffe119 #0082c8 #f58231 #911eb4 #008080 #e6beff #aa6e28] + background_colors: %I[eastern_blue eastern_blue], + label_colors: %I[crimson fruit_salad lemon bondi_blue sun dark_orchid teal mauve hot_toddy] }.freeze RITA = { marker_color: 'black', font_color: 'black', - background_colors: %w[#d1edf5 white], - label_colors: %w[#46f0f0 #f032e6 #d2f53c #fabebe #008080 #e6beff #aa6e28 #fffac8 #800000] + background_colors: %I[pattens_blue white], + label_colors: %I[turquoise razzle_dazzle_rose pear your_pink teal mauve hot_toddy lemon_chiffon maroon] }.freeze # Plain White back ground with no gradient. CLASSIC_WHITE = { marker_color: 'black', font_color: 'black', - background_colors: %w[white white], - label_colors: %w[#1f77b4 #ff7f0e #2ca02c #d62728 #9467bd #8c564b\ -#e377c2 #7f7f7f #bcbd22 #17becf yellow maroon grey] + background_colors: %I[white white], + label_colors: %I[strong_blue vivid_orange dark_lime_green strong_red slightly_desaturated_violet \ +dark_grey strong_yellow strong_cyan yellow maroon grey] }.freeze end end