Class: ImageMosaic::Data::Background

Inherits:
Object
  • Object
show all
Defined in:
lib/image_mosaic/data/background.rb

Constant Summary collapse

PATTERN =
/^#([0-9a-fA-F]{3}){1,2}$/

Instance Method Summary collapse

Constructor Details

#initialize(hex) ⇒ Background

Returns a new instance of Background.



6
7
8
# File 'lib/image_mosaic/data/background.rb', line 6

def initialize(hex)
  @hex = hex
end

Instance Method Details

#hexObject



10
11
12
# File 'lib/image_mosaic/data/background.rb', line 10

def hex
  valid? ? @hex : COLOUR
end