std.experimental.color, request reviews

Andrea Fontana via Digitalmars-d digitalmars-d at puremagic.com
Wed Jun 24 00:58:49 PDT 2015


On Tuesday, 23 June 2015 at 14:58:35 UTC, Manu wrote:
> https://github.com/D-Programming-Language/phobos/pull/2845
>
> I'm getting quite happy with it.
> I think it's a good and fairly minimal but useful starting 
> point.
>
> It'd be great to get some reviews from here.

Some points about blend/lerp:

- Using operation on rgb components usually doesn't give the 
expected result. It should be done, for example, blending hue 
saturation and brightness, rather than Red, Blue, Green (or at 
least using toLinear?)

- What happens if srcFactor + destFactor != 1? Maybe we should 
normalize srcFactor and destFactor on 0..1 using something like:
normSrcFactor = srcFactor/(srcFactor+DestFactor);
normDestFactor = destFactor/(srcFactor+DestFactor);

- Does it work with RGB only?


More information about the Digitalmars-d mailing list