Options
All
  • Public
  • Public/Protected
  • All
Menu

Index

Variables

Let colorMap

colorMap: ColorMap

Const colorRegexp

colorRegexp: RegExp = /(#[A-F\d]{3}\b|#[A-F\d]{6}\b)|(rgba?[\s+]?\([\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?([, \.\d]+)?\))/gi

Let fileCounter

fileCounter: number = 0

Const sassVariableRegexp

sassVariableRegexp: RegExp = /(\$[\S\d]+)\b/gi

Functions

addToMap

  • addToMap(color: string, colorData: ColorMeta, map: ColorMap): ColorMap
  • Mutate global map of colors

    Parameters

    • color: string

      Long variant of color

    • colorData: ColorMeta

      All color metadata

    • map: ColorMap

      Global mutable map

    Returns ColorMap

countAndPrintProcessedFiles

  • countAndPrintProcessedFiles(filePath: string, colors: string[]): number
  • warning Change global counter and log to console

    Parameters

    • filePath: string

      current processing file's directory

    • colors: string[]

      total number parsed colors in the file

    Returns number

gather

  • gather(dir: string, skip: string): ColorMap
  • Basically the gathering function runner which mutate global colorMap

    Parameters

    • dir: string

      directory for colors scanning

    • skip: string

      fullpath to the color scheme file for example colors.sass with all color variables

    Returns ColorMap

main

  • main(files: string[], dir: string, skip: string): void
  • Task for processing files list

    Parameters

    • files: string[]

      array of file names

    • dir: string

      path to the dir which contains the files

    • skip: string

      fullpath to the color scheme file for example colors.sass with all color variables

    Returns void

parseColorSheme

  • parseColorSheme(data: string): SchemeData[]
  • Search for colors in color scheme and prepare data output for view Usually there is at least basic color scheme in project, for instance colors.sass or variables.sass contains a set of colors which was originally designed for the project

    Parameters

    • data: string

    Returns SchemeData[]

    Array of objects { color: , variable: }

parseSchemeFile

  • parseSchemeFile(schemeFilePath: string): SchemeData[]
  • Task for parsing and getting scheme data

    Parameters

    • schemeFilePath: string

      location of scheme file

    Returns SchemeData[]

parseStylesheetsColors

  • parseStylesheetsColors(data: string, filePath: string, map: ColorMap): string[]
  • Search for colors in stylesheets, add them into color map

    Parameters

    • data: string

      content of the given file

    • filePath: string

      full path to the given file

    • map: ColorMap

      global mutable color map

    Returns string[]

    Array of colors

pathType

  • pathType(path: string): string | undefined
  • Checks whether path related to file, directory or undefined

    Parameters

    • path: string

    Returns string | undefined

processDir

  • processDir(path: string, skip: string): void
  • Processes directory at given path, collects file names and run main script recursively

    Parameters

    • path: string

      to

    • skip: string

      fullpath to the color scheme file for example colors.sass with all color variables

    Returns void

processFile

  • processFile(filePath: string): void

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Type alias with type parameter
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc