Method: Color.try_convert

Defined in:
lib/rgss3/color.rb

.try_convert(color) ⇒ Object



122
123
124
125
126
127
128
129
130
131
132
133
134
135
# File 'lib/rgss3/color.rb', line 122

def self.try_convert(color)
  case color
  when Color
    color
  when String
    from_pixel Magick::Pixel.from_color(color)
  when Integer
    from_int(color)
  when Magick::Pixel
    from_pixel(color)
  when Gosu::Color
    from_gosu(color)
  end
end