Skip to content
This repository has been archived by the owner on Dec 24, 2022. It is now read-only.

Commit

Permalink
Added function to convert hexstrings into color
Browse files Browse the repository at this point in the history
  • Loading branch information
pgtgrly committed Jul 17, 2018
1 parent 25b251d commit b6a2f0c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion examples/RubyPlot/BarPlotSpace.rb
Expand Up @@ -9,6 +9,6 @@
t << (t[-1] + 0.1)
end
a = Rubyplot::Figure.new
a.bar! values, bar_color: :green, bar_gap: 1
a.bar! values, bar_color: :white, bar_gap: 1
a.line!(t, V)
a.view
9 changes: 8 additions & 1 deletion lib/grruby/tasks/gr_function_classes.rb
@@ -1,6 +1,12 @@
module Rubyplot
module GRWrapper
module Tasks
def inqcolorfromrgb(rgbstring)
rgb = rgbstring.match /(..)(..)(..)/
GR.inqcolorfromrgb((rgb[1].hex/255).to_f, (rgb[2].hex/255).to_f, (rgb[3].hex/255).to_f)
end


class BeginPrint
attr_reader :file_name

Expand Down Expand Up @@ -288,7 +294,8 @@ def call
blue: 257,
green: 477,
red: 367,
easy_blue: 989
easy_blue: 989,
white: 91
}.freeze

GR_FONTS = {
Expand Down

0 comments on commit b6a2f0c

Please sign in to comment.