colour lib
Andrea Fontana via Digitalmars-d
digitalmars-d at puremagic.com
Wed Aug 31 00:58:36 PDT 2016
On Wednesday, 31 August 2016 at 06:17:15 UTC, Manu wrote:
> On 31 August 2016 at 16:01, Chris Wright via Digitalmars-d
> <digitalmars-d at puremagic.com> wrote:
>> The color models I'm aware of are HSV, HSL, RGB[A], CMYK, Lab,
>> Pantone, and the Open Colour Standard.
>
> I'll initially support, XYZ/xyY, RGB (which is a gigantic set),
> HSx, Lab, Yuv.
>
>
>> I'm not sure what common operations they have.
>
> All colours can add, subtract, scale luminance.
>
>
>> Perhaps you could provide a link to your existing library?
>
> https://github.com/TurkeyMan/color
I always think the perfect colour library should work using a
superset of all colour spaces, for example cie xyz (is it a
superset, isn't it?). isColour(T) then IMO should check if x,y,z
properties exists (or toXYZ() method).
In this way every algorithm like "blend" or anything else could
be implemented just for xyz (and eventually specialized for other
colours if we want to avoid conversion overhead). In this way it
become easy to do cross-colour operations (for example: apply a
rgb mask over another color space) and to implement new or
strange color spaces (that automagically will work with all
"blend" & co.). To implement a new color spaces you just need to
map it to xyz (that should represent all - and more - visible
colours: rgb is a subset of visibile colours)
Andrea
More information about the Digitalmars-d
mailing list