
Security News
npm Adopts OIDC for Trusted Publishing in CI/CD Workflows
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
Are you looking for an amazing avatar generator for your website users? ruby_randimage is your gem!
A powerful, customizable and sophisticated awesome SVG avatars generator from several options such as symmetries, size, color palette and color densities.
RubyRandimage is a pure Ruby library without any dependencies.
We have implemented a demo app for you to try out: Demo App
Here is the repository: https://github.com/camumino/ruby_randimage_demoapp
Add this line to your application's Gemfile:
gem 'ruby_randimage'
And then execute:
$ bundle
Or install it yourself as:
$ gem install ruby_randimage
Create a random svg image saved on the file system.
RubyRandimage.create_and_save_file("ruby_randimage.svg")
Create a random svg image String
svg = RubyRandimage.create
Returned String can be used in a simple way in your HTML document settting a size for your image
<img src="data:image/svg+xml;utf8, <%= raw(svg) %>" width="200px">
Random svg image can be customized setting the following options:
title: (String) SVG <title> tag for image. Example: "awesome_avatar"
colors: (Array) colors to compose your image, Example: ["#aaaaaa", "#990000"] or ["#aaa", "#900"].
symmetry_axes: (Array).
- No symmetry: [false, false]
- X symmetry: [true, false]
- Y symmetry: [false, true]
- Full symmetry: [true, true]
num_cells: (Fixnum) Number of rows and columns in the image. Min: 2, Max:16
seed: (Fixnum) seed to set random numbers.
Examples
svg = RubyRandimage.create( title: "ruby rand image", num_cells: 8, colors: ["#fff", "f00"], symmetry_axes: [true, true])
Colors tip: You can define each color density setting the same color multiple times. For example to create an image with aproximately 75% white cells and 25% red cells you can do:
svg = RubyRandimage.create( title: "ruby rand image", num_cells: 8, colors: ["#fff", "#fff", "#fff", "f00"], symmetry_axes: [true, true])
Bug reports and pull requests are welcome on GitHub at https://github.com/santiriera626/ruby_randimage. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.
The gem is available as open source under the terms of the MIT License.
FAQs
Unknown package
We found that ruby_randimage demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
Research
/Security News
A RubyGems malware campaign used 60 malicious packages posing as automation tools to steal credentials from social media and marketing tool users.
Security News
The CNA Scorecard ranks CVE issuers by data completeness, revealing major gaps in patch info and software identifiers across thousands of vulnerabilities.