f
This commit is contained in:
parent
74fcf2a9f2
commit
c65acc6cd7
1 changed files with 2 additions and 2 deletions
|
@ -39,14 +39,14 @@ func lerp*(a, b: Color, v: float32): Color {.inline.} =
|
||||||
result.a = lerp(a.a, b.a, v)
|
result.a = lerp(a.a, b.a, v)
|
||||||
|
|
||||||
proc toPremultipliedAlpha*(c: Color): Color {.inline.} =
|
proc toPremultipliedAlpha*(c: Color): Color {.inline.} =
|
||||||
## Converts a color to premultiplied alpha from straight.
|
## Converts a color to premultiplied alpha from straight alpha.
|
||||||
result.r = c.r * c.a
|
result.r = c.r * c.a
|
||||||
result.g = c.g * c.a
|
result.g = c.g * c.a
|
||||||
result.b = c.b * c.a
|
result.b = c.b * c.a
|
||||||
result.a = c.a
|
result.a = c.a
|
||||||
|
|
||||||
proc toStraightAlpha*(c: Color): Color {.inline.} =
|
proc toStraightAlpha*(c: Color): Color {.inline.} =
|
||||||
## Converts a color to from premultiplied alpha to straight.
|
## Converts a color from premultiplied alpha to straight alpha.
|
||||||
if c.a != 0 and c.a != 1:
|
if c.a != 0 and c.a != 1:
|
||||||
result = c
|
result = c
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in a new issue