fix c255 for rgb conversion
This commit is contained in:
parent
a422b2462d
commit
bbcbc3df5e
1 changed files with 2 additions and 2 deletions
|
@ -14,8 +14,6 @@ import (
|
|||
"github.com/stanim/gofpdf"
|
||||
)
|
||||
|
||||
const c255 = 254.0 / 65535.0
|
||||
|
||||
var (
|
||||
caps = map[draw2d.Cap]string{
|
||||
draw2d.RoundCap: "round",
|
||||
|
@ -27,6 +25,8 @@ func notImplemented(method string) {
|
|||
fmt.Printf("%s: not implemented\n", method)
|
||||
}
|
||||
|
||||
const c255 = 255.0 / 65535.0
|
||||
|
||||
func rgb(c color.Color) (int, int, int) {
|
||||
r, g, b, _ := c.RGBA()
|
||||
return int(float64(r) * c255), int(float64(g) * c255), int(float64(b) * c255)
|
||||
|
|
Loading…
Reference in a new issue