Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dannyben/victor
Ruby SVG Image Builder
https://github.com/dannyben/victor
gem image-api ruby svg svg-builder svg-image
Last synced: about 8 hours ago
JSON representation
Ruby SVG Image Builder
- Host: GitHub
- URL: https://github.com/dannyben/victor
- Owner: DannyBen
- License: mit
- Created: 2016-05-27T14:42:49.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2024-08-29T09:37:47.000Z (4 months ago)
- Last Synced: 2024-12-19T17:05:48.247Z (7 days ago)
- Topics: gem, image-api, ruby, svg, svg-builder, svg-image
- Language: Ruby
- Homepage: https://victor.dannyb.co
- Size: 768 KB
- Stars: 378
- Watchers: 11
- Forks: 20
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# Victor - Ruby SVG Image Builder
[![Gem Version](https://badge.fury.io/rb/victor.svg)](https://badge.fury.io/rb/victor)
[![Build Status](https://github.com/DannyBen/victor/workflows/Test/badge.svg)](https://github.com/DannyBen/victor/actions?query=workflow%3ATest)
[![Maintainability](https://api.codeclimate.com/v1/badges/85cc05c219d6d233ab78/maintainability)](https://codeclimate.com/github/DannyBen/victor/maintainability)## [victor.dannyb.co](https://victor.dannyb.co)
---
**Victor** is a lightweight, zero-dependencies Ruby library that lets you build
SVG images using Ruby code.---
## Install
```
$ gem install victor
```## Example
```ruby
setup viewBox: '0 0 100 100'build do
rect x: 0, y: 0, width: 100, height: 100, fill: :white
circle cx: 50, cy: 50, r: 40, fill: 'yellow'
rect x: 10, y: 50, width: 80, height: 50, fill: :yellow[25, 50].each do |x|
circle cx: x, cy: 40, r: 8, fill: :white
endpath fill: 'white', d: %w[
M11 100 l13 -15 l13 15 l13 -15
l13 15 l13 -15 l13 15 Z
]
end
```## Documentation
- [Victor Homepage][docs]
## Contributing / Support
If you experience any issue, have a question or a suggestion, or if you wish
to contribute, feel free to [open an issue][issues] or
[start a discussion][discussions].[issues]: https://github.com/DannyBen/victor/issues
[discussions]: https://github.com/DannyBen/victor/discussions
[docs]: https://victor.dannyb.co/