Coder Social home page Coder Social logo

niceqr's Introduction

NiceQR

Cool Looking QR Code library based on ZXing ("zebra crossing"). Main features are:

  • Colored QR Codes
  • Rounded Borders
  • Rounded Positional Elements
  • Inside Logo

Usage

Artifacts are hosted on Bintray Jcenter. To use them add JCenter repository to your pom.xml

	<repositories>
		<repository>
			<id>bintray-jcenter</id>
			<name>bintray-jcenter</name>
			<url>https://jcenter.bintray.com</url>
		</repository>
	</repositories>

Then add NiceQR dependency

	</dependencies>
	...
		<dependency>
		    <groupId>org.lome</groupId>
		    <artifactId>niceqr</artifactId>
		    <version>0.1.0</version>
		</dependency>
	...
	</dependencies>

Samples

"Traditional" QR Code

		QrEngine.buildQrCode(text, 
				new File("samples/sample1.png"),
				QrConfiguration.builder()
				.withSize(200)
				.withRelativeBorderSize(.0)
				.withRelativeBorderRound(.0)
				.withDarkColor(Color.black)
				.withLightColor(Color.white)
				.withPositionalsColor(Color.black)
				.withRelativePositionalsRound(.0)
				.withCircularPositionals(false)
				.build());

alt

Add some border to increase readability

		QrEngine.buildQrCode(text, 
				new File("samples/sample2.png"),
				QrConfiguration.builder()
				.withSize(200)
				.withRelativeBorderSize(.05)
				.withRelativeBorderRound(.0)
				.withDarkColor(Color.black)
				.withLightColor(Color.white)
				.withPositionalsColor(Color.black)
				.withRelativePositionalsRound(.0)
				.withCircularPositionals(false)
				.build());

alt

Round that border a bit

		QrEngine.buildQrCode(text, 
				new File("samples/sample3.png"),
				QrConfiguration.builder()
				.withSize(200)
				.withRelativeBorderSize(.05)
				.withRelativeBorderRound(.2)
				.withDarkColor(Color.black)
				.withLightColor(Color.white)
				.withPositionalsColor(Color.black)
				.withRelativePositionalsRound(.0)
				.withCircularPositionals(false)
				.build());

alt

Round positional elements

		QrEngine.buildQrCode(text, 
				new File("samples/sample4.png"),
				QrConfiguration.builder()
				.withSize(200)
				.withRelativeBorderSize(.05)
				.withRelativeBorderRound(.2)
				.withDarkColor(Color.black)
				.withLightColor(Color.white)
				.withPositionalsColor(Color.black)
				.withRelativePositionalsRound(.3)
				.withCircularPositionals(false)
				.build());

alt

Add some colors

		QrEngine.buildQrCode(text, 
				new File("samples/sample5.png"),
				QrConfiguration.builder()
				.withSize(200)
				.withRelativeBorderSize(.05)
				.withRelativeBorderRound(.2)
				.withDarkColor(new Color(0x0063,0x000B,0x00A5))
				.withLightColor(Color.white)
				.withPositionalsColor(new Color(0x00F4,0x0014,0x0038))
				.withRelativePositionalsRound(.3)
				.withCircularPositionals(false)
				.build());

alt

Use circles as positional elements

		QrEngine.buildQrCode(text, 
				new File("samples/sample6.png"),
				QrConfiguration.builder()
				.withSize(200)
				.withRelativeBorderSize(.05)
				.withRelativeBorderRound(.2)
				.withDarkColor(new Color(0x0063,0x000B,0x00A5))
				.withLightColor(Color.white)
				.withPositionalsColor(new Color(0x00F4,0x0014,0x0038))
				.withCircularPositionals(true)
				.build());

alt

Add a logo inside the QR Code

		QrEngine.buildQrCodeWithLogo(text, 
				new File(logo),
				new File("samples/sample7.png"),
				QrConfiguration.builder()
				.withSize(200)
				.withRelativeBorderSize(.05)
				.withRelativeBorderRound(.2)
				.withDarkColor(new Color(0x0063,0x000B,0x00A5))
				.withLightColor(Color.white)
				.withPositionalsColor(new Color(0x00F4,0x0014,0x0038))
				.withCircularPositionals(true)
				.withRelativeLogoSize(.249)
				.build());

alt

Warnings

This library is provided as-is. Please make sure to test the readability of generated QR Codes before distributing them.

niceqr's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

niceqr's Issues

JCenter EOL - Moving to another repo?

Since JCenter has been discontinued and will continue as a read-only repository indefinitely, wouldn't it make sense to migrate to another repository like Maven Central?

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.