Class: Spectra::Palette

Inherits:
View
  • Object
show all
Defined in:
lib/spectra/views/palette.rb

Instance Attribute Summary

Attributes inherited from View

#colors, #prefix

Instance Method Summary collapse

Methods inherited from View

#format_color_name, #format_color_value, from_attributes, #initialize, #render, template_name, #to_s, #views_from_colors

Methods included from Serializable

#destination, #serialize, #write_file

Constructor Details

This class inherits a constructor from Spectra::View

Instance Method Details

#directoryObject

Pathing



16
17
18
# File 'lib/spectra/views/palette.rb', line 16

def directory 
  @directory || "#{Dir.home}/Library/Colors/"
end

#filenameObject



20
21
22
# File 'lib/spectra/views/palette.rb', line 20

def filename
  super || "#{self.prefix}-palette.clr"
end

#renamerObject



8
9
10
# File 'lib/spectra/views/palette.rb', line 8

def renamer
  @renamer || lambda { |color, prefix| color.name.camelize(true) + color.suffix }
end