Brightness confusion

If you're having trouble using Context Free or don't understand the language, ask for help here.

Moderators: MtnViewJohn, chris, mtnviewmark

Post Reply
jonniemarbles
Posts: 3
Joined: Tue Nov 14, 2017 3:53 am

Brightness confusion

Post by jonniemarbles »

I'm aware there is a post about this in the FAQ but I will admit I found it confusing, partly because it refers to syntax several years out of date. I want to create a rule that starts bright but gets dimmer with each iteration. I've yet to find a way to make this work: my attempts either result in totally bright or totally black shapes.

I understand that the problem here is (generally) that the rules are resetting each other, but how do I fix it?

For example, let's say I want the following shape to start bright and dim to 0.8 of its previous value with each iteration:

Code: Select all

startshape THING

shape THING
{
SQUARE[s 1 saturation 1 alpha 0 b 0.8 hue 150]
THING[y 1 s 0.98 b 0.8] 
}
How would I make that happen? Many thanks in advance, sorry for the noob question.

User avatar
MtnViewJohn
Site Admin
Posts: 882
Joined: Fri May 06, 2005 2:26 pm
Location: Mountain View, California
Contact:

Re: Brightness confusion

Post by MtnViewJohn »

I would do it like so:

Code: Select all

startshape THING[b 0.8]
// Increases initial brightness from 0 to 0.8

shape THING
{
    SQUARE[s 1 saturation 1 alpha 0 hue 150]
        // b 0.8 has been removed
    THING[y 1 s 0.98 b -0.1] 
        // This makes each generation a little less bright
}

Post Reply