@@ -12,11 +12,17 @@ type Color interface {
12
12
// for the color. Each value ranges within [0, 0xFFFF], but is represented
13
13
// by a uint32 so that multiplying by a blend factor up to 0xFFFF will not
14
14
// overflow.
15
+ //
16
+ // An alpha-premultiplied color component c has been scaled by alpha (a),
17
+ // so has valid values 0 <= c <= a.
15
18
RGBA () (r , g , b , a uint32 )
16
19
}
17
20
18
- // RGBA represents a traditional 32-bit alpha-premultiplied color,
19
- // having 8 bits for each of red, green, blue and alpha.
21
+ // RGBA represents a traditional 32-bit alpha-premultiplied color, having 8
22
+ // bits for each of red, green, blue and alpha.
23
+ //
24
+ // An alpha-premultiplied color component C has been scaled by alpha (A), so
25
+ // has valid values 0 <= C <= A.
20
26
type RGBA struct {
21
27
R , G , B , A uint8
22
28
}
@@ -33,8 +39,11 @@ func (c RGBA) RGBA() (r, g, b, a uint32) {
33
39
return
34
40
}
35
41
36
- // RGBA64 represents a 64-bit alpha-premultiplied color,
37
- // having 16 bits for each of red, green, blue and alpha.
42
+ // RGBA64 represents a 64-bit alpha-premultiplied color, having 16 bits for
43
+ // each of red, green, blue and alpha.
44
+ //
45
+ // An alpha-premultiplied color component C has been scaled by alpha (A), so
46
+ // has valid values 0 <= C <= A.
38
47
type RGBA64 struct {
39
48
R , G , B , A uint16
40
49
}
0 commit comments