Colour pinstripe/Printer: Difference between revisions
→{{header|Go}}: Tweaked drawing parameters to produce 1 inch bands when printing on A4 paper.
(Added Go) |
(→{{header|Go}}: Tweaked drawing parameters to produce 1 inch bands when printing on A4 paper.) |
||
Line 60:
{{works with|Windows 10}}
<br>
The code for this task is
<lang go>package main
Line 82:
func pinstripe(dc *gg.Context) {
w := dc.Width()
h := dc.Height() /
for b := 1; b <=
for x, ci := 0, 0; x < w; x, ci = x+b, ci+1 {
dc.SetHexColor(palette[ci%8])
Line 94:
func main() {
dc := gg.NewContext(
pinstripe(dc)
dc.SavePNG("color_pinstripe.png")
|