MCPcopy Index your code
hub / github.com/tdewolff/canvas / rgbaColor

Function rgbaColor

util.go:193–206  ·  view source on GitHub ↗
(col color.Color)

Source from the content-addressed store, hash-verified

191}
192
193func rgbaColor(col color.Color) color.RGBA {
194 r, g, b, a := col.RGBA()
195 // RGBA returns an alpha-premultiplied color so that c <= a. We silently correct the color by clipping r,g,b to a
196 if a < r {
197 r = a
198 }
199 if a < g {
200 g = a
201 }
202 if a < b {
203 b = a
204 }
205 return color.RGBA{uint8(r >> 8), uint8(g >> 8), uint8(b >> 8), uint8(a >> 8)}
206}
207
208////////////////////////////////////////////////////////////////
209

Callers 9

AddMethod · 0.85
FaceMethod · 0.85
FaceMethod · 0.85
FontStrokeFunction · 0.85
SetFillMethod · 0.85
SetFillColorMethod · 0.85
SetStrokeMethod · 0.85
SetStrokeColorMethod · 0.85
NewHatchPatternFunction · 0.85

Calls 1

RGBAMethod · 0.45

Tested by

no test coverage detected