16.6.1 • Published 4 years ago

@the-/icon v16.6.1

Weekly downloads
201
License
MIT
Repository
github
Last release
4 years ago

@the-/icon

npm Version

Icon generator

Installation

$ npm install @the-/icon --save

Usage

'use strict'

/**
 * The is an example of Icon
 * @file example-usage.js
 */
const theIcon = require('@the-/icon')

const { Themes } = theIcon

async function tryExample() {
  const text = 'APE'
  const color = '#EA1'

  await theIcon({
    color,
    font: 'fonts/comicsans.ttf',
    text,
    theme: Themes.SQUARE,
  }).saveAs('foo/square-icon.png')
}

tryExample().catch((err) => console.error(err))

Themes

ThemeSample OutputSample code
Themes.CIRCLEtheIcon({ theme:Themes.CIRCLE, text:'APE', color: '#A11', }).saveAs('circle.png')
Themes.CIRCLE_FILLtheIcon({ theme:Themes.CIRCLE_FILL, text:'APE', color: '#A11', }).saveAs('circle-fill.png')
Themes.ROUNDtheIcon({ theme:Themes.ROUND, text:'APE', color: '#A11', }).saveAs('round.png')
Themes.ROUND_FILLtheIcon({ theme:Themes.ROUND_FILL, text:'APE', color: '#A11', }).saveAs('round-fill.png')
Themes.SQUAREtheIcon({ theme:Themes.SQUARE, text:'APE', color: '#A11', }).saveAs('square.png')
Themes.SQUARE_FILLtheIcon({ theme:Themes.SQUARE_FILL, text:'APE', color: '#A11', }).saveAs('square-fill.png')

API Guide

See API Guide for more detail

License

This software is released under the MIT License.

Links