geopattern

:triangular_ruler: Create beautiful generative image patterns from a string in golang.

Github星跟蹤圖

geopattern

Create beautiful generative image patterns from a string in golang.

Go port of Jason Long's awesome GeoPattern library.

GoDoc

Read geopattern's development story geo_pattern: going on the Go path

Nested Squares Pattern

Generate beautiful tiling SVG patterns from a string. The string is converted into a SHA and a color and pattern are determined based on the values in the hash. The color is determined by shifting the hue from a default (or passed in) base color. One of 16 patterns is used (or you can specify one) and the sizing of the pattern elements is also determined by the hash values.

You can use the generated pattern as the background-image for a container. Using the base64 representation of the pattern still results in SVG rendering, so it looks great on retina displays.

See the GitHub Guides site as an example of this library in action. GitHub Guides use Original Ruby implementation.

Installation

go get github.com/pravj/geopattern

Usage

Example directory contains sample go programs that explains use of geopattern

API

Arguments for functions returning pattern's string

phrase : custom pattern phrase

args := map[string]string{"phrase": "My Custom Phrase"}

generator : custom pattern type

args := map[string]string{"generator": "plaid"}

color : custom background color

args := map[string]string{"color": "#3b5998"}

baseColor : custom base color that decides background color

args := map[string]string{"baseColor": "#ffcc00"}

Functions provided by package for pattern's string representation

Get the SVG string :

Generate(args)

Get the Base64 encoded string :

Base64String(args)

Get uri image string :

URIimage(args)

Available Pattern

chevrons

Chevrons

concentric-circles

Concentric-Circles

diamonds

Diamonds

hexagons

Hexagons

mosaic-squares

Mosaic-Squares

nested-squares

Nested-Squares

octagons

Octagons

overlapping-circles

Overlapping-Circles

overlapping-rings

Overlapping-rings

plaid

Plaid

plus-signs

Plus-Signs

sine-waves

Sine-Waves

squares

Squares

tessellation

Tessellation

triangles

Triangles

xes

Xes

Dependencies

go-colorful : for color space conversion


Made with Muzi and Appy by Pravendra Singh

主要指標

概覽
名稱與所有者pravj/geopattern
主編程語言Go
編程語言Go (語言數: 1)
平台
許可證MIT License
所有者活动
創建於2014-10-22 17:26:30
推送於2019-01-08 20:17:57
最后一次提交2017-05-10 00:12:50
發布數7
最新版本名稱v1.4.1 (發布於 2015-03-10 13:26:49)
第一版名稱v1.0.0 (發布於 2015-03-06 11:28:15)
用户参与
星數1.3k
關注者數24
派生數64
提交數53
已啟用問題?
問題數5
打開的問題數0
拉請求數4
打開的拉請求數3
關閉的拉請求數0
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?