Skip to content

Commit

Permalink
Merge pull request #121 from khalilfazal/master
Browse files Browse the repository at this point in the history
ruby 2.4.0 merged Fixnum and Bignum into Integer
  • Loading branch information
glejeune authored Jan 22, 2017
2 parents dfe8cee + 773c231 commit cd3c594
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/graphviz/utils/colors.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,28 +14,28 @@ def initialize
end

def rgb(r, g, b, a = nil)
if r.is_a?(Fixnum)
if r.is_a?(Integer)
r = r.to_s.convert_base(10, 16)
end
unless r.is_a?(String) and HEX_FOR_COLOR.match(r)
raise ColorException, "Bad red value"
end

if g.is_a?(Fixnum)
if g.is_a?(Integer)
g = g.to_s.convert_base(10, 16)
end
unless g.is_a?(String) and HEX_FOR_COLOR.match(g)
raise ColorException, "Bad green value"
end

if b.is_a?(Fixnum)
if b.is_a?(Integer)
b = b.to_s.convert_base(10, 16)
end
unless b.is_a?(String) and HEX_FOR_COLOR.match(b)
raise ColorException, "Bad blue value"
end

if a.is_a?(Fixnum)
if a.is_a?(Integer)
a = a.to_s.convert_base(10, 16)
end
unless a.nil? or (a.is_a?(String) and HEX_FOR_COLOR.match(a))
Expand Down

0 comments on commit cd3c594

Please sign in to comment.