Class: Magick::ImageColors

Inherits:
Object
  • Object
show all
Defined in:
lib/rmagick/image_colors.rb,
lib/rmagick/image_colors/version.rb

Constant Summary collapse

VERSION =
"0.1.4"

Instance Method Summary collapse

Constructor Details

#initialize(file_path = nil, image: nil, &block) ⇒ ImageColors

Returns a new instance of ImageColors.



6
7
8
9
10
11
12
13
14
# File 'lib/rmagick/image_colors.rb', line 6

def initialize(file_path=nil, image: nil, &block)
  if image
    @image = image
  else
    @image = Magick::Image.read(file_path).first
  end

  aggregate(&block)
end

Instance Method Details

#colorsObject



16
17
18
# File 'lib/rmagick/image_colors.rb', line 16

def colors
  @colors
end