16.6.1 • Published 4 years ago
@the-/icon v16.6.1
@the-/icon
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
Theme | Sample Output | Sample code |
---|---|---|
Themes.CIRCLE | theIcon({ theme:Themes.CIRCLE, text:'APE', color: '#A11', }).saveAs('circle.png') | |
Themes.CIRCLE_FILL | theIcon({ theme:Themes.CIRCLE_FILL, text:'APE', color: '#A11', }).saveAs('circle-fill.png') | |
Themes.ROUND | theIcon({ theme:Themes.ROUND, text:'APE', color: '#A11', }).saveAs('round.png') | |
Themes.ROUND_FILL | theIcon({ theme:Themes.ROUND_FILL, text:'APE', color: '#A11', }).saveAs('round-fill.png') | |
Themes.SQUARE | theIcon({ theme:Themes.SQUARE, text:'APE', color: '#A11', }).saveAs('square.png') | |
Themes.SQUARE_FILL | theIcon({ theme:Themes.SQUARE_FILL, text:'APE', color: '#A11', }).saveAs('square-fill.png') |
API Guide
- module:@the-/icon
- module:@the-/icon.helpers
- TheIcon
See API Guide for more detail
License
This software is released under the MIT License.