lib/greyscale.rb
#
# Compute light-based greyscale value for an RGB pixel.
# @param red [Integer]
# @param green [Integer]
# @param blue [Integer]
#
# @return [Integer]
Compute light-based greyscale value for an RGB pixel.
Compute light - based greyscale value for an RGB pixel .
def light(red, green, blue)
      max = [red, green, blue].max
      min = [red, green, blue].min
      (max + min) / 2
    end
def light ( red , green , blue ) max = [ red , green , blue ] . max min = [ red , green , blue ] . min ( max + min ) / 2 end
Compute light-based greyscale value for an RGB pixel.
Compute light - based greyscale value for an RGB pixel .
None
Integer
red
<not_specific>
green
<not_specific>
blue
<not_specific>
<not_specific>
None