Skip to content

Commit 37ea8e4

Browse files
author
Guillaume Piolat
committed
Comment suspicious function with word of warning.
1 parent 214b64d commit 37ea8e4

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

graphics/dplug/graphics/color.d

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -495,6 +495,9 @@ RGBA blendColor(RGBA fg, RGBA bg, ubyte alpha) pure nothrow @nogc
495495
/// Blend two colors, where `fg` is a premultiplied color by its own alpha.
496496
/// We consider fg to be already scaled by (alpha/255)
497497
/// Return: (255-alpha)
498+
/// Note: if your premultiplied color were converted from 16-bit premultiplied
499+
/// colors and basically truncated, expect issues! See imageknob.d for
500+
/// what could happen.
498501
RGBA blendColorPremul(RGBA fg, RGBA bg, ubyte alpha) pure nothrow @nogc
499502
{
500503
ubyte invAlpha = cast(ubyte)(~cast(int)alpha);

0 commit comments

Comments
 (0)