Skip to content

Generate low polygon background image from a identifier string. Image's characters will be decided by the identifier string. Written in google closure.

License

Notifications You must be signed in to change notification settings

waythe/closure-low-poly-background

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Low Poly background image generator

(closure-low-poly-background)
Generate low polygon background image from a identifier string.
Image's characters will be decided by the identifier string.
Written in google closure.

Usage

	goog.require('wythe.lowpolybg')

	// detail of options described in next segment
	var options = {width:600, height:300,cellSize:45};

	// 'HelloWorld' is an identifier, pass different strings to generate different result
	var canvas = wythe.lowpolybg.createLowPolyCanvas('HelloWorld', options);

Demo Result(Picture generated from 'HelloWorld'):

image

Options

    width: 400, // Width of the generated canvas
    height: 200, // Height of the generated canvas
    cellSize: 30, // Expect size of triangle blocks, actual size will be randomized by variance parameter
    variance: 0.75, // Defined how much to randomize the block size
    palette: wythe.lowpolybg.DEFAULT_PALETTE, // Palette of the canvas, this directly influence the generated result, by default we use ColorBrewer for chroma.js
    shareColor: true, // If set to true, x and y will share the same palette. Recommend to keep it 'true', using different palette sometime will make the graph too messy.
    lineWidth: 1 // Line width of the triangles

Borrow from:

https://github.com/ironwallaby/delaunay
https://github.com/gka/chroma.js/blob/master/src/colors/colorbrewer.coffee

License

Apache License Version 2.0

About

Generate low polygon background image from a identifier string. Image's characters will be decided by the identifier string. Written in google closure.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published