washowasho / jadenticon

Java wrapper for jdenticon

Home Page:http://atomfrede.github.io/jadenticon/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Build Status Latest Release Codacy Codecov branch Dependency Status Gitter

Jadenticon

Jadenticon is a simple java wrapper for the Jdenticon javascript library to create nice looking, random identicons.

Get It

Jadenticon is available on Jitpack.

Gradle

repositories {
    maven { url "https://jitpack.io" }
}

dependencies {
   compile 'com.github.atomfrede:jadenticon:1.4.0'
}

Maven

<repository>
    <id>jitpack.io</id>
    <url>https://jitpack.io</url>
</repository>

<dependency>
    <groupId>com.github.atomfrede</groupId>
	<artifactId>jadenticon</artifactId>
	<version>1.4.0</version>
</dependency>

Usage

// Create default jdenticon (as svg) with size 300 and padding 0.08
String rawSvg = Jadenticon.from("Jane Doe").toSvg();

// Create a jdenticon with size 555 and padding 0.08
// Restriction: 30 <= size
String rawSvgWithSize = Jadenticon.from("Jane Doe").withSize(555).toSvg();

// Create a jdenticon with size 300 and padding 0.1
// Restriction: 0 <= padding <= 0.5
String rawSvgWithPadding = Jadenticon.from("John Doe").withPadding(0.1);

// You can save it directly to a svg file, the .svg suffix is added automatically
File svgFile = Jadenticon.from("Jane Doe").file("janedoe");

// You can save it directly to a png file, the .png suffix is added automatically
File pngFile = Jadenticon.from("Janet Doe").png("janetdoe");

// If you don't care about the file you don't need to provide any
File svgFile2 = Jadenticon.from("John Doe").file();
File pngFile2 = Jadenticon.from("Johnny Doe").png();

Example

example jdenticon

License

Apache-2.0 © Frederik Hahne

About

Java wrapper for jdenticon

http://atomfrede.github.io/jadenticon/

License:Apache License 2.0


Languages

Language:Java 100.0%