(c color.Color)
| 112 | } |
| 113 | |
| 114 | func (e *Canvas) SetColor(c color.Color) { |
| 115 | if c == nil { |
| 116 | c = color.Black |
| 117 | } |
| 118 | if e.context().color != c { |
| 119 | e.context().color = c |
| 120 | r, g, b, _ := c.RGBA() |
| 121 | mx := float64(math.MaxUint16) |
| 122 | fmt.Fprintf(e.buf, "%.*g %.*g %.*g setrgbcolor\n", pr, float64(r)/mx, |
| 123 | pr, float64(g)/mx, pr, float64(b)/mx) |
| 124 | } |
| 125 | } |
| 126 | |
| 127 | func (e *Canvas) Rotate(r float64) { |
| 128 | fmt.Fprintf(e.buf, "%.*g rotate\n", pr, r*180/math.Pi) |
no test coverage detected