[RFC] New module: Graphics::ColorUtils
[RFC] New module: Graphics::ColorUtils
am 13.11.2006 20:23:39 von PKJ
I am looking for comments on a new module I propose
for inclusion in CPAN:
Graphics::ColorUtils
This module will provide helper functions to manage
color. It will be useful when generating graphics using
modules such as GD, Tk, or when generating HTML/CSS.
The module provides three sets of features:
- Color space conversion (RGB to HSV, etc)
- Color gradients (useful for data visualization)
- Color lookup by name
The main rationale for creating a new module was
the need for a module with easy-to-use color conversions
(easier than Graphics::ColorObject). Also, color gradients
are often useful for data visualization, but are currently not
offered by any Perl module (that I am aware of). Name
lookup has been thrown in for good measure, but I do not
consider it essential (Graphics::ColorNames does something
very similar).
The design objectives were:
- A simple and intuitive API, which has a small enough
footprint that it can be used inline in calls to other
functions.
- Platform independence (do not assume X11)
- Minimal dependencies
The current version of the code and documentation are
available here:
http://www.beyondcode.org/projects/index.html
Related modules and existing work:
- Graphics::ColorObject (and Color::Object) do color space
conversions, but using a very different API, much less
suitable for the intended usage of the proposed module.
- Graphics::ColorNames and Color::Rgb do color-for-name
lookup. (There is real redundancy with ColorNames
and the current module - should it be dropped? However,
there is real benefit in keeping all functionality together.)
- No module offers color gradients (to my knowledge).
Any thoughts/suggestions?
Re: [RFC] New module: Graphics::ColorUtils
am 13.11.2006 21:53:14 von Ron Savage
On Tue, 14 Nov 2006 06:23:39 +1100, pkj wrote:
Hi
> The module provides three sets of features:
> - Color space conversion (RGB to HSV, etc)
> - Color gradients (useful for data visualization)
> - Color lookup by name
How about putting these 3 features in 3 modules, all under your chosen
namespace?
Re: [RFC] New module: Graphics::ColorUtils
am 13.11.2006 21:55:10 von John Bokma
"pkj" wrote:
> - Graphics::ColorNames and Color::Rgb do color-for-name
I suggest to call the latter Color::RGB, the Rgb is going to confuse me at
least, and might confuse more people.
> - No module offers color gradients (to my knowledge).
I am very interested in this one :-D.
--
John Experienced Perl programmer: http://castleamber.com/
Perl help, tutorials, and examples: http://johnbokma.com/perl/
Re: New module: Graphics::ColorUtils
am 13.11.2006 22:40:30 von PKJ
Just to clarify - I did NOT write Color::Rgb. That is a pre-existing
module,
which I am just mentioning here for comparison purposes.
John Bokma wrote:
> "pkj" wrote:
>
> > - Graphics::ColorNames and Color::Rgb do color-for-name
>
> I suggest to call the latter Color::RGB, the Rgb is going to confuse me at
> least, and might confuse more people.
>
> > - No module offers color gradients (to my knowledge).
>
> I am very interested in this one :-D.
>
> --
> John Experienced Perl programmer: http://castleamber.com/
>
> Perl help, tutorials, and examples: http://johnbokma.com/perl/
Re: [RFC] New module: Graphics::ColorUtils
am 13.11.2006 22:51:03 von Dean Arnold
pkj wrote:
> I am looking for comments on a new module I propose
> for inclusion in CPAN:
> Graphics::ColorUtils
>
> This module will provide helper functions to manage
> color. It will be useful when generating graphics using
> modules such as GD, Tk, or when generating HTML/CSS.
>
> The module provides three sets of features:
> - Color space conversion (RGB to HSV, etc)
> - Color gradients (useful for data visualization)
> - Color lookup by name
>
Out of curiousity, which gradient functions are you
implementing ? FWIW: I've implemented some primitive
gradient support in Tk::StyledButton, but would certainly appreciate
a more robust, and separately packaged, solution.
Dean Arnold
Presicient Corp.
Re: New module: Graphics::ColorUtils
am 13.11.2006 23:01:39 von PKJ
Actually - none. The module comes with some pre-packaged
gradients (as data), which are chosen to provide a visually
uniform impression.
Thanks for the hint, though - I will take a look.
Dean Arnold wrote:
(snip)
>
> Out of curiousity, which gradient functions are you
> implementing ? FWIW: I've implemented some primitive
> gradient support in Tk::StyledButton, but would certainly appreciate
> a more robust, and separately packaged, solution.
>
> Dean Arnold
> Presicient Corp.
Re: New module: Graphics::ColorUtils
am 14.11.2006 00:30:06 von John Bokma
"pkj" wrote:
>
> Just to clarify - I did NOT write Color::Rgb. That is a pre-existing
> module,
> which I am just mentioning here for comparison purposes.
Ah, my bad, apologies.
--
John Experienced Perl programmer: http://castleamber.com/
Perl help, tutorials, and examples: http://johnbokma.com/perl/