1.0.0 • Published 3 years ago

peeps-builder v1.0.0

Weekly downloads
-
License
MIT
Repository
-
Last release
3 years ago

Peeps Builder

Image generated with peeps builder

Peeps Builder is a Typescript library for building svgs using Pablo Stanley's Open Peeps project.

Parts of this library are based on react-peeps by CreamKrier.

This library doesn't include every part, I'll be adding them if/when I get time. PRs welcome.

Installation

Available from npm with

npm install peeps-builder

Usage

import { Peep } from "../src/Peep";
import { PeepConfig } from "../src/PeepConfig";
import fs from 'fs';

const peep: PeepConfig = {
    x: 0,
    y: 0,
    width: 1050,
    height: 1200,
    head: {
        hair: {
            name: "MediumThree",
            strokeColor: "#D698FF",
        },
        face: {
            name: "Cheeky"
        },
        accessory: "Glasses",
        mask: {
            name: "None",
            fillColor: "lightblue",
            strokeColor: "grey"
        }
    },
    pose: {
        name: "ButtonShirtOne",
        fillColor: "grey",
        accentColor: "white",
        strokeColor: "black"
    },
    strokeColor: "black",
    fillColor: "#FFDBB4",
    accentColor: "white",
    skinColor: "#FFDBB4"
}

fs.writeFile('test/test.svg', new Peep(peep).build(), "utf8", () => {
    console.log("Written to test.svg");
});

Options

Hair

NameskinColorstrokeColorhairColoraccentColor
AfroYesYesNoNo
BangsOneYesYesYesNo
BunYesYesYesNo
BeanieYesYesNoYes
NoHairYesYesNoNo

Face

NamestrokeColoraccentColor
AngryYesNo
AweYesYes
CheekyYesNo
SmileYesNo

Facial Hair

NameColor
FullFull

Accessory

NamestrokeColor
GlassesYes
GlassesTwoYes

Mask

NamestrokeColorfillColor
MedicalMaskYesYes
RespiratorYesYes

Pose

NameskinColorstrokeColorfillColoraccentColor
BlazerBlackTeeNoYesYesNo
ButtonShirtOneYesYesYesNo
ButtonShirtTwoNoYesYesNo
CoffeeYesYesYesYes
DeviceNoYesYesNo
DressNoYesYesNo
SelenaTeeYesYesNoNo
ShirtAndCoatYesYesYesYes