Class: FileAccess

FileSystem. FileAccess

Provides file read and write functionality


new FileAccess(source, outputPath, outputName)

Parameters:
Name Type Description
source string

The source file/url parsed for color values

outputPath string

The provided directory to save the generated output files

outputName string

The provided name for the generated output files

Source:

Methods


readFile(callback)

Reads a file and extracts the contents

The file opened is specified on the command line. The entire text is returned for the subsequent
parsing of CSS color values

Parameters:
Name Type Description
callback function

The function to call with the input source data when complete

Source:

writeCss(outputPath, name, hexColors, colorFormat, styleType)

Writes color palette

The type of file to create (CSS, GIMP, LESS, SASS) is based on the styleType parameter. Which
color format to write (Hex, HSL, RGB) is specified via the colorFormat parameter.

Parameters:
Name Type Default Description
outputPath string

The type of stylesheet: CSS, SASS, LESS

name string

The name given to the output files

hexColors Array.<string>

A string array containing the color palette as Hexadecimal values

colorFormat string hex

CSS color format to use when writing file: Hex, HSL, or RGB

styleType string

The type of stylesheet: CSS, SASS, LESS

Source: