Module: Miro

Defined in:
lib/miro.rb,
lib/miro/version.rb,
lib/miro/dominant_colors.rb

Defined Under Namespace

Classes: DominantColors

Constant Summary collapse

VERSION =
"0.4.0"

Class Method Summary collapse

Class Method Details

.histogram?Boolean

Returns:

  • (Boolean)

26
27
28
# File 'lib/miro.rb', line 26

def histogram?
  options[:method] == 'histogram'
end

.optionsObject


12
13
14
15
16
17
18
19
20
21
# File 'lib/miro.rb', line 12

def options
  convert = `which convert`.strip
  @options ||= {
    :image_magick_path  => convert.length > 0 ? convert : '/usr/bin/convert',
    :resolution         => "150x150",
    :color_count        => 8,
    :quantize           => 'RGB',
    :method             => 'pixel_group'
  }
end

.pixel_group?Boolean

Returns:

  • (Boolean)

22
23
24
# File 'lib/miro.rb', line 22

def pixel_group?
  options[:method] == 'pixel_group'
end