Page 1 of 1

Decreasing level of brightness

Posted: Wed Aug 05, 2009 11:37 am
by archpaladin1
I have a simple recursive shape:

Code: Select all

startshape start

rule start {
	SQUARE {
		sat .7
		hue 50
		brightness 0
	}
	start {
		rotate -5
		size .9
		brightness .1
	}
}
This shape goes from dark to light. I would like to go the other way - from light to dark. I would think that this would work:

Code: Select all

startshape start


rule start {
	SQUARE {
		sat .7
		hue 50
		brightness 1
	}
	start {
		rotate -5
		size .9
		brightness -.1
	}
}
It doesn't. Instead I just get a yellow square. What do I need to do to recursively lower the brightness level?

Posted: Wed Aug 05, 2009 4:38 pm
by MtnViewJohn
You first have to increase the darkness level before you can decrease it. Sat, hue, and brightness do not set the color components to the following value, they modify the current color.

Code: Select all

startshape brightstart 

rule brightstart {
   start {
      brightness 1
   }
}

rule start { 
   SQUARE { 
      sat .7 
      hue 50 
      brightness 0 
   } 
   start { 
      rotate -5 
      size .9 
      brightness -.1 
   } 
} 

Posted: Thu Aug 06, 2009 5:41 am
by archpaladin1
So if I'm understanding you correctly, it sounds like the hue, sat, and brightness modifiers perform different operations based on where they are, and I had them in the wrong location.

Incidentally, the following also works, which cuts down on irrelevant attributes and is closer to what I was originally thinking.

Code: Select all

startshape brightstart

rule brightstart {
   start {
      sat .7
      hue 50
      brightness 1
   }
}

rule start {
   SQUARE {   }
   start {
      rotate -5
      size .9
      brightness -.1
   }
}
Thanks for the help.