• Stars
    star
    1,256
  • Rank 37,419 (Top 0.8 %)
  • Language
    Go
  • License
    MIT License
  • Created about 10 years ago
  • Updated almost 6 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

📐 Create beautiful generative image patterns from a string in golang.

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

More Repositories

1

Doga

📈 HTTP log monitoring console for Humans
Python
240
star
2

puzzl

🎲 An intelligent version of the sliding-puzzle game for your terminal built in golang
Go
37
star
3

ospi

Open Source Presence Infographic of Indian Startups
Python
24
star
4

termping

A prototype of old game Pong. this time, in your terminal.
CoffeeScript
24
star
5

lisense

Sensible repository licensing for Humans
Python
23
star
6

teamwork

Organization's Contribution Dashboard : GitHub Data Challenge 3
Python
21
star
7

semantris-solver

Automated solver for Semantris using OpenCV and Word Embeddings
Jupyter Notebook
14
star
8

HackLime

Sublime-Text Editor plugin to compile/run using HackerEarth's API
Python
12
star
9

inside-cricket

Source code for "Inside Cricket: A fifth umpire' view of your favorite sport"
JavaScript
11
star
10

cqueue

circular buffer implementation in golang using linked-list
Go
9
star
11

pravj.github.io

My Hugo powered real-estate in webspace.
HTML
9
star
12

engine

Distributed identifier generation service
Python
9
star
13

github-dynamics

Source code for "Information Dynamics on the GitHub Network"
Jupyter Notebook
8
star
14

wiggle

Material Design powered responsive Jekyll theme for blogs
JavaScript
7
star
15

ipython_slack_client

IPython frontend that runs in Slack [WIP]
Python
7
star
16

Harry

jekyll plugin to have :smileys: in your blogs
Ruby
6
star
17

Bangalore-taxis

Code used to analyse patterns in my post 'Bangalore-taxis'
R
5
star
18

virtual-wall

painting a virtual wall
Go
5
star
19

orbis

WORK UNDER PROGRESS - game based on floodfill built with python Gtk
Python
5
star
20

Fuel

Analyzing the data for 'Breaking into the Indian E-commerce'
Python
5
star
21

x3030

Maze game for Google Chrome based on that bug.
JavaScript
4
star
22

Fubot

Fubot is your Helper for Facebook
JavaScript
4
star
23

kayak

A customizable Twitter client to collect tweets matching certain criteria
Python
4
star
24

logg

yet another analyzer for time travelling your git logs
Python
4
star
25

Post-mortem

Post-mortem of an Internet Accident
Python
4
star
26

Cursor

A flat Jekyll theme as a memory review tool
CSS
3
star
27

glox

Interpreter for the 'Lox' language written in Go
Go
3
star
28

gitpool

Personal GitHub Warehouse
Jupyter Notebook
3
star
29

puzzl.arXiv

Paper that highlights technical details about the game puzzl,
TeX
3
star
30

redirector-v2

"redirector#v2" allow to download songs from "Muzi" [a great online music player inside IITR Campus by SDSLabs].
PHP
3
star
31

data-artistry-2018

📊 Submission for Data Artistry Tournament (2018) **Selected for finals**
Jupyter Notebook
2
star
32

beehub

GitHub oauth application in Beego framework
Go
2
star
33

PeopleMotion

Team Page for Kshitij Magazine, Developed by me.
JavaScript
2
star
34

molecules

molecules contains some of code snippets I have written, here and there.
Python
2
star
35

vingvong

Game of PingPong in your Vim
Vim Script
2
star
36

modified-lanyon

Customized 'Lanyon' Jekyll theme that powers my Blog
CSS
2
star
37

Etios

Yet another sexy Jekyll theme in the party
JavaScript
2
star
38

captron

An 'apt' cron job service in golang
Go
1
star
39

simple_canvas_game

a simple HTML5-canvas game...Original Source is Here : Build a simple HTML5 Canvas game!
JavaScript
1
star
40

Programming-Collective-Intelligence

Excercises from the book : Programming Collective Intelligence
Python
1
star
41

rugo

An experimental Ruby to Go transpiler toolchain [under-development]
Go
1
star
42

dotfiles

dotfiles are meant to be loved, extensively 💕
Vim Script
1
star