POV-Ray : Newsgroups : povray.general : Feature request: Native support for HSL color space Server Time
31 Jul 2024 16:21:01 EDT (-0400)
  Feature request: Native support for HSL color space (Message 1 to 6 of 6)  
From: Shark
Subject: Feature request: Native support for HSL color space
Date: 21 Oct 2006 22:45:00
Message: <web.453ada061e40103e473080560@news.povray.org>
Hi.

I would like to request that POV-Ray natively support color spaces other
than RGB (namely HSL) without having to use conversion formulas and all
that.

Thank you!


Post a reply to this message

From: Tim Attwood
Subject: Re: Feature request: Native support for HSL color space
Date: 21 Oct 2006 23:21:29
Message: <453ae3b9$1@news.povray.org>
> I would like to request that POV-Ray natively support color spaces other
> than RGB (namely HSL) without having to use conversion formulas and all
> that.
There's macros in colors.inc for that...
CHSL2RGB( )

I'm not sure what syntax you would sugest, you'd need a
hsl keyword similar to rgb?
pigment {color hsl <1,1,1>} // like this?

I don't care for the look of CHSL2RGB() but it can
be redefined
#macro hsl(A) CHSL2RGB(A) #end
Then you'd end up with
pigment {color hsl(<1,1,1>)}
which isn't much different.


Post a reply to this message

From: Shark
Subject: Re: Feature request: Native support for HSL color space
Date: 22 Oct 2006 01:30:00
Message: <web.453b01bf2b38173297b9615b0@news.povray.org>
"Tim Attwood" <tim### [at] comcastnet> wrote:
> > I would like to request that POV-Ray natively support color spaces other
> > than RGB (namely HSL) without having to use conversion formulas and all
> > that.
> There's macros in colors.inc for that...
> CHSL2RGB( )
>
> I'm not sure what syntax you would sugest, you'd need a
> hsl keyword similar to rgb?
> pigment {color hsl <1,1,1>} // like this?

Yes, that is along the lines of what I was thinking. We'd need an hslt
keyword, as well (for the transparency).

> I don't care for the look of CHSL2RGB() but it can
> be redefined
> #macro hsl(A) CHSL2RGB(A) #end
> Then you'd end up with
> pigment {color hsl(<1,1,1>)}
> which isn't much different.

Does the CHSL2RGB function take transparency into account? E.g., can the
function take a color vector with more than three components? The docs
don't say.


Post a reply to this message

From: Tim Attwood
Subject: Re: Feature request: Native support for HSL color space
Date: 22 Oct 2006 04:50:53
Message: <453b30ed$1@news.povray.org>
> Does the CHSL2RGB function take transparency into account? E.g., can the
> function take a color vector with more than three components? The docs
> don't say.
Yes, it can use 5d colors, or promote from 3d colors.


Post a reply to this message

From: PoD
Subject: Re: Feature request: Native support for HSL color space
Date: 23 Oct 2006 07:33:03
Message: <pan.2006.10.23.11.32.16.817738@internode.on.net>
On Sat, 21 Oct 2006 20:21:28 -0700, Tim Attwood wrote:

>> I would like to request that POV-Ray natively support color spaces other
>> than RGB (namely HSL) without having to use conversion formulas and all
>> that.
> There's macros in colors.inc for that...
> CHSL2RGB( )
> 
> I'm not sure what syntax you would sugest, you'd need a
> hsl keyword similar to rgb?
> pigment {color hsl <1,1,1>} // like this?
> 
> I don't care for the look of CHSL2RGB() but it can
> be redefined
> #macro hsl(A) CHSL2RGB(A) #end
> Then you'd end up with
> pigment {color hsl(<1,1,1>)}
> which isn't much different.

Still not the same as having native support for hsl.
If I specify a colour_map with
[0 rgb<1,0,0>]
[1 rgb<0,1,0>]
then the colour at 0.5 will be rgb<0.5,0.5,0>

however
[0 hsl<0,1,1>]
[1 hsl<1,1,1>]
should give hsl<0.5,1,1> at 0.5 which still has full saturation and
luminance.

This would be very useful to have, though I can't see it happening in the
near future.

-- 
PoD.


Post a reply to this message

From: Trevor G Quayle
Subject: Re: Feature request: Native support for HSL color space
Date: 24 Oct 2006 09:00:00
Message: <web.453e0d352b381732c150d4c10@news.povray.org>
"Tim Attwood" <tim### [at] comcastnet> wrote:
> > I would like to request that POV-Ray natively support color spaces other
> > than RGB (namely HSL) without having to use conversion formulas and all
> > that.
> There's macros in colors.inc for that...
> CHSL2RGB( )
>
> I'm not sure what syntax you would sugest, you'd need a
> hsl keyword similar to rgb?
> pigment {color hsl <1,1,1>} // like this?
>
> I don't care for the look of CHSL2RGB() but it can
> be redefined
> #macro hsl(A) CHSL2RGB(A) #end
> Then you'd end up with
> pigment {color hsl(<1,1,1>)}
> which isn't much different.

Or perhaps:
#macro hsl(A,B,C) CHSL2RGB(<A,B,C>) #end

that way a set of brackets can be dropped:
pigment {color hsl(1,1,1)}

(however, it does miss the visual cue of the vector brackets)

-tgq


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.