comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Color gradients lib
Date: Tue, 8 Feb 2011 19:00:08 +0100
Date: 2011-02-08T19:00:05+01:00	[thread overview]
Message-ID: <1lxxuu6fkr6fy.1dw6oop7xv799.dlg@40tude.net> (raw)
In-Reply-To: iir7k6$dfi$1@news.eternal-september.org

On Tue, 08 Feb 2011 11:58 +0100, Alex R. Mosteo wrote:

> I need to plot some data (2D maps) and I have everything in my drawing 
> library except some readily usable gradients. I was wondering if some Ada 
> library out there has this before making my custom one.

OK, that is an ill-defined problem because the visual appearance of a
gradient (linear function of position) depends on the color space you are
using. The RGB color space is quite unnatural to human eye. L*a*b is much
better,  but computationally problematic. HLS is a very coarse
approximation of L*a*b. GtkAda contributions has an implementation of
improved HLS model.

http://www.dmitry-kazakov.de/ada/gtkada_contributions.htm#8

For building a gradient I would convert the end points to IHLS and then use
linear functions for hue, luminance and saturation between the points. The
obtained IHLS colors are then converted back to RGB.

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de



  parent reply	other threads:[~2011-02-08 18:00 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-08 10:58 Color gradients lib Alex R. Mosteo
2011-02-08 13:16 ` Yannick Duchêne (Hibou57)
2011-02-08 14:52   ` Alex R. Mosteo
2011-02-08 15:18     ` Yannick Duchêne (Hibou57)
2011-02-08 15:21       ` Yannick Duchêne (Hibou57)
2011-02-08 16:27         ` Alex R. Mosteo
2011-02-08 19:30           ` Yannick Duchêne (Hibou57)
2011-02-08 18:00 ` Dmitry A. Kazakov [this message]
2011-02-08 19:27   ` Yannick Duchêne (Hibou57)
2011-02-08 19:36     ` Yannick Duchêne (Hibou57)
2011-02-08 19:54     ` Dmitry A. Kazakov
2011-02-09  8:53   ` Alex R. Mosteo
2011-02-08 20:26 ` Gautier write-only
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox