class ImageMosaic::Data::Background

Constants

PATTERN

Public Class Methods

new(hex) click to toggle source
# File lib/image_mosaic/data/background.rb, line 6
def initialize(hex)
  @hex = hex
end

Public Instance Methods

hex() click to toggle source
# File lib/image_mosaic/data/background.rb, line 10
def hex
  valid? ? @hex : COLOUR
end

Private Instance Methods

match() click to toggle source
# File lib/image_mosaic/data/background.rb, line 20
def match
  @hex =~ PATTERN
end
valid?() click to toggle source
# File lib/image_mosaic/data/background.rb, line 16
def valid?
  !!match
end