sprator
TypeScript icon, indicating that this package has built-in type declarations

0.1.9 • Public • Published

Sprator

npm latest version semantic-release

This is a TypeScript implementation of Sprator (original is C++).

Sprator is a npm package to generate sprites using cellular automaton. Generated sprites is given as Buffer object in Node.js.

This image is from original Sprator repo.

Installation

You can install this package via npm.

npm install sprator

Requirement

Node.js v10 or higher.

Sprator Server

Deploy

This package includes simple server using express. You can use it locally by following command.

npm start

Then the server is on http://localhost:3000

The server responds to GET request with any URL and accepts by following queries.

Query

Example

e.g. http://localhost:3000?seed=1d14f&dot=8&ppd=8&fill=palegreen&border=forestgreen&background=rgba(128,128,128,0.8)

https://sprator.herokuapp.com/?seed=1d14c&dot=8&ppd=8&fill=palegreen&border=darkolivegreen&background=rgba(225,225,225,0.8)

seed

Random string represents seed of generation.

Default: empty string

dot

Number of dots in an edge. 6 or more (must be even)

Default: 10

ppd

Numbrer of pixels in a dot. e.g. If dot=10 and ppd=4, the image pattern size is 40x40, and output image size is 64x64 (includes 12px margin).

Default: 10

fill

Fill color can be used on the Canvas.

You must encode # (%23) on URL.

Default: #228b22

border

Border color can be used on the Canvas.

Default: #2f4f4f

background

Background color can be used on the Canvas.

Default: #000000

Usage

以前作ったアイコン生成ソフトをリメイクした - 屋根裏

License

Sprator is licensed under the MIT license. See the LICENSE for more information.

Readme

Keywords

Package Sidebar

Install

npm i sprator

Weekly Downloads

1

Version

0.1.9

License

MIT

Unpacked Size

33.5 kB

Total Files

32

Last publish

Collaborators

  • teramotodaiki