Module: Imatcher::ColorMethods

Includes:
ChunkyPNG::Color
Included in:
Image, Modes::Base
Defined in:
lib/imatcher/color_methods.rb

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#blueObject



24
25
26
# File 'lib/imatcher/color_methods.rb', line 24

def blue
  rgb(0, 0, 255)
end

#brightness(a) ⇒ Object



12
13
14
# File 'lib/imatcher/color_methods.rb', line 12

def brightness(a)
  0.3 * r(a) + 0.59 * g(a) + 0.11 * b(a)
end

#greenObject



20
21
22
# File 'lib/imatcher/color_methods.rb', line 20

def green
  rgb(0, 255, 0)
end

#redObject



16
17
18
# File 'lib/imatcher/color_methods.rb', line 16

def red
  rgb(255, 0, 0)
end