Built upon Ruby Matrix. Includes serveral renderers.
Add this line to your application's Gemfile:
gem 'identicon', github: 'max-power/identicon'
require 'identicon/svg'
Identicon.new('hi').to_svg
icon = Identicon.new("some_string", rows: 5, cols: 5)
icon.digest
icon.binary
icon.matrix
icon.color
require 'identicon/all'
icon.to_svg(options)
icon.to_png(options)
icon.to_html(options)
icon.to_text(options)
⬜⬜⬜⬜⬜
⬛⬛⬛⬛⬛
⬛⬜⬛⬜⬛
⬛⬛⬛⬛⬛
⬜⬛⬜⬛⬜
or use the Renderer:
Identicon::SVG.new(options).render(icon)
Identicon::PNG.new(options).render(icon)
Identicon::HTML.new(options).render(icon)
Identicon::Text.new(options).render(icon)
invert
Boolean: (default: false)width
Integer: Image width in Pixels (default: 240)height
Integer: Image height in Pixels (default: width)padding
Float(0..1): Padding as percentage of a block size
- Fork it ( http://github.com/max-power/identicon/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request