Git Product home page Git Product logo

geo_pattern's Introduction

geo_pattern

now create beautiful generative background images from a string in golang.

Go port of Jason Long's awesome GeoPattern library.

GoDoc

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/geo_pattern

####Usage Example directory contains sample go programs that explains use of geo_pattern

####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"}

######base_color : custom base color that decides background color

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

#####Functions provided by package for pattern's string representation

######Get the SVG string :

Generate(args)

######Get the Base64 encoded string :

Base64_string(args)

######Get uri image string :

Uri_image(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

geo_pattern's People

Contributors

follower avatar pravj avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.