color() misbehaving on Mac OS X build?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

color() misbehaving on Mac OS X build?

Mike Thomson
Hi folks

I'm blown away by OpenSCAD - Just working on a parameterised model of
my RepRap machine - it's awesome to be able to tweak a value and see
the whole machine rescale itself to accommodate the new part!

However, I've one minor niggle:
OpenSCAD 2010.01 running on Mac OS X 10.6.2 (Snow Leopard) seems to
struggle with the new color() function.

Essentially I can only set r,g,b values to 0 or 255 - anything from
1-254 seems to be interpreted the same as 255.
So my palette is white, black, red, green, blue, yellow, cyan, magenta.

Am I alone?

Cheers
Mike

Reply | Threaded
Open this post in threaded view
|

Re: color() misbehaving on Mac OS X build?

clothbot
Hey Mike,

Try with the "Development Snapshot" instead.  The code-base is still  
very much a moving target so there's no specific advantage to sticking  
with the 2010.01 image.

Post your code! :-)

Andrew.

On 22-Jan-10, at 5:04 PM, Mike Thomson wrote:

> Hi folks
>
> I'm blown away by OpenSCAD - Just working on a parameterised model of
> my RepRap machine - it's awesome to be able to tweak a value and see
> the whole machine rescale itself to accommodate the new part!
>
> However, I've one minor niggle:
> OpenSCAD 2010.01 running on Mac OS X 10.6.2 (Snow Leopard) seems to
> struggle with the new color() function.
>
> Essentially I can only set r,g,b values to 0 or 255 - anything from
> 1-254 seems to be interpreted the same as 255.
> So my palette is white, black, red, green, blue, yellow, cyan,  
> magenta.
>
> Am I alone?
>
> Cheers
> Mike
> _______________________________________________
> OpenSCAD mailing list
> [hidden email]
> http://rocklinux.net/mailman/listinfo/openscad

--

"The future is already here.  It's just not very evenly distributed"  
-- William Gibson




Reply | Threaded
Open this post in threaded view
|

Re: color() misbehaving on Mac OS X build?

Clifford Wolf
In reply to this post by Mike Thomson
Hi Mike,

On Fri, Jan 22, 2010 at 10:04:22PM +0000, Mike Thomson wrote:
> OpenSCAD 2010.01 running on Mac OS X 10.6.2 (Snow Leopard) seems to
> struggle with the new color() function.
>
> Essentially I can only set r,g,b values to 0 or 255 - anything from
> 1-254 seems to be interpreted the same as 255.

The valid values for color() are values from 0 to 1, not 0 to 255.
E.g.: color([0.7, 0.7, 1]) { }

yours,
 - clifford

--
There are some things a reboot won't fix.

Reply | Threaded
Open this post in threaded view
|

Re: color() misbehaving on Mac OS X build?

Mike Thomson
In reply to this post by Mike Thomson
Oops.

On Fri, Jan 22, 2010 at 10:04 PM, Mike Thomson
<[hidden email]> wrote:
> OpenSCAD 2010.01 running on Mac OS X 10.6.2 (Snow Leopard) seems to
> struggle with the new color() function.
>
> Essentially I can only set r,g,b values to 0 or 255 - anything from
> 1-254 seems to be interpreted the same as 255.

My error - the values are floating point not integer in the range 0.0 ... 1.0.

I updated the Wikibooks page to reflect this:
http://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#color

Cheers
Mike