if (do_name() != 'Home') : ?>
endif ?>
Posted by Nbveh Masala on Dec 05, 2008
here little example showing this problem(tell me if it is only me see it in red color...:)
size (400,400) speed (30) def setup(): colors = ximport("colors") global col,sat,count col=color(random(),random(),random()) sat=1 count=0 def draw(): global sat global count fill(col) rect(WIDTH/2-50,HEIGHT/2-50,100,100,0.3) col.saturation=sat if count==0: sat-=0.03 else: sat+=0.03 if sat<=0.0: count=1 elif sat>=1: count=0
Posted by Stefan G on Dec 05, 2008
This won't fix your problem with the pink coloring though. I think it's because when a color is completely desaturated (saturation equals to 0) you get a grey color (red == green == blue). So the hue information gets lost here, it becomes 0 (or 1) as well. And a hue of 0 or 1 is a red hue. So you could either store the hue value in your setup function and reuse that in your draw function or either prevent the saturation value from ever becoming 0.
First of, you're just importing the colors library but not using it.
So you should write
col=colors.Color(random(),random(),random())if you want to use the colors functionality.
This won't fix your problem with the pink coloring though. I think it's because when a color is completely desaturated (saturation equals to 0) you get a grey color (red == green == blue). So the hue information gets lost here, it becomes 0 (or 1) as well. And a hue of 0 or 1 is a red hue. So you could either store the hue value in your setup function and reuse that in your draw function or either prevent the saturation value from ever becoming 0.
Posted by nbveh Masala on Dec 05, 2008
include("util/comment.php"); ?>
i`ll try it! thanx!
Colors library saturation function problem
Posted by nbveh Masala on Dec 03, 2008Hello!
and this in drawI`m using colors library for creating gradient background of screen, both colors of gradient are random. Also for using in fullscreen mode, my patch making little oval mouse pointer. Both of element changing dynamically it`s saturation from 1 to 0 and back, with different speed(kinda hypnotic,pulsing color effect).
Everything working fine, but i just realized(after adding mouse pointer element, where saturation change cycle much more faster) that whatever color was randomly chosen by program, after first cycle it turns into kind of pink... weird!
i`m using this line in setup