Class: Imagga::ImageColor

Inherits:
ImageInfoBase show all
Defined in:
lib/imagga/image.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from ImageInfoBase

#initialize

Constructor Details

This class inherits a constructor from Imagga::ImageInfoBase

Class Method Details

.fieldsObject



48
49
50
# File 'lib/imagga/image.rb', line 48

def self.fields
  %w(percent r g b html_code closest_palette_color closest_palette_color_parent closest_palette_distance)
end

Instance Method Details

#infoObject



64
65
66
# File 'lib/imagga/image.rb', line 64

def info
  "%.2f\%%, rgb: (%i,%i,%i), hex: %s" % [percent, r, g, b, html_code]
end

#percent=(value) ⇒ Object



60
61
62
# File 'lib/imagga/image.rb', line 60

def percent=(value)
  @percent = value.to_f
end