Module: Procreate::Swatches
- Defined in:
- lib/procreate/swatches.rb,
lib/procreate/swatches/parser.rb,
lib/procreate/swatches/version.rb,
lib/procreate/swatches/wrapper.rb,
lib/procreate/swatches/exporter.rb,
lib/procreate/swatches/colors_helper.rb,
lib/procreate/swatches/errors/invalid_path.rb,
lib/procreate/swatches/errors/invalid_format.rb
Overview
Interact with .swatches
files (Procreate) and manipulate them.
Defined Under Namespace
Modules: ColorsHelper, Errors Classes: Exporter, Parser, Wrapper
Constant Summary collapse
- SWATCHES_FILE_NAME =
Internal name of the
.swatches
file. Used for both parsing and exporting.swatches
files. 'Swatches.json'
- VERSION =
Current gem version
'0.1.4'
Class Method Summary collapse
-
.export(name, colors, options = {}) ⇒ String
(also: to_file)
Export an array of colors to a
.swatches
file, with the possibility to provide a custom palette name. -
.parse(file_path) ⇒ Procreate::Swatches::Wrapper
(also: from_file)
Parse a
.swatches
file from the provided file path.
Class Method Details
.export(name, colors, options = {}) ⇒ String Also known as: to_file
Export an array of colors to a .swatches
file, with the possibility to provide a custom palette name.
50 51 52 53 54 |
# File 'lib/procreate/swatches.rb', line 50 def export(name, colors, = {}) wrapper = Wrapper.new(name, colors) Exporter.call(wrapper, ) end |
.parse(file_path) ⇒ Procreate::Swatches::Wrapper Also known as: from_file
Parse a .swatches
file from the provided file path
35 36 37 |
# File 'lib/procreate/swatches.rb', line 35 def parse(file_path) Parser.call(file_path) end |