Comments (1)
Yes, the package can handle this, although "grid of colors" is a bit ambiguous.
Take a look at https://speakerdeck.com/ajstarks/svgo-code-plus-picture-examples
Here is one (page 10)
(Also note that a version is included in the package (along with other examples). See the richter directory
package main
import (
"math/rand"
"os"
"time"
"github.com/ajstarks/svgo"
)
var (
canvas = svg.New(os.Stdout)
width = 500
height = 500
)
// inspired by Gerhard Richter's 256 colors, 1974
func main() {
rand.Seed(time.Now().Unix())
canvas.Start(width, height)
canvas.Rect(0, 0, width, height)
w, h, gutter := 24, 18, 5
rows, cols := 16, 16
top, left := 20, 20
for r, x := 0, left; r < rows; r++ {
for c, y := 0, top; c < cols; c++ {
canvas.Rect(x, y, w, h,
canvas.RGB(rand.Intn(255), rand.Intn(255), rand.Intn(255)))
y += (h + gutter)
}
x += (w + gutter)
}
canvas.End()
}
from svgo.
Related Issues (20)
- Text() attribute styling/spacing HOT 7
- Including units and floating point values HOT 2
- Just Want to Say Thank You HOT 1
- Pdf to SVG HOT 1
- Pdf to SVG HOT 1
- Add <title> to individual element? HOT 2
- Defining marker orientation HOT 4
- Potential code quality issues found
- Getting the getComputedTextLength() HOT 2
- Please add module support! HOT 2
- Requesting support for tspan HOT 4
- rotate(deg, cx, cy) HOT 1
- Support importing a svg into the SVG object HOT 4
- add method
- html to svg HOT 1
- Dead link to SVGo Paper HOT 1
- Add method for rotation around the center
- Please add LICENSE HOT 3
- Textlength attribute on Text HOT 1
- Help drawing a vertical text? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from svgo.