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 exactlybasically the same as for [[Colour_pinstripe/Display#Go]] except that the drawing parameters have been tweaked to produce 1 inch bands when printing on A4 paper and some code has been added to dump the image to the default printer.
<lang go>package main
Line 82:
func pinstripe(dc *gg.Context) {
w := dc.Width()
h := dc.Height() / 47
for b := 1; b <= 411; 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(900842, 600595)
pinstripe(dc)
dc.SavePNG("color_pinstripe.png")
9,485

edits