05-22-2009, 05:21 PM
Taking from Punk's earlier example, you may see how easy it is to read and debug the code if formatted with line breaks:
# Background Tone (Red)
@backgroundtone[bgt].viewport.tone.red =
(@backgroundtone[bgt].viewport.tone.red *
(@backgroundtone_c[bgt][3] - 1) +
@backgroundtone_c[bgt][1].red) /
@backgroundtone_c[bgt][3]
# Background Tone (Green)
@backgroundtone[bgt].viewport.tone.green =
(@backgroundtone[bgt].viewport.tone.green *
(@backgroundtone_c[bgt][3] - 1) +
@backgroundtone_c[bgt][1].green) /
@backgroundtone_c[bgt][3]
# Background Tone (Blue)
@backgroundtone[bgt].viewport.tone.blue =
(@backgroundtone[bgt].viewport.tone.blue *
(@backgroundtone_c[bgt][3] - 1) +
@backgroundtone_c[bgt][1].blue) /
@backgroundtone_c[bgt][3]
# Background Tone (Gray)
@backgroundtone[bgt].viewport.tone.gray =
(@backgroundtone[bgt].viewport.tone.gray *
(@backgroundtone_c[bgt][3] - 1) +
@backgroundtone_c[bgt][1].gray) /
@backgroundtone_c[bgt][3]
Yeah... I did the colors too.
@backgroundtone[bgt].viewport.tone.red =
(@backgroundtone[bgt].viewport.tone.red *
(@backgroundtone_c[bgt][3] - 1) +
@backgroundtone_c[bgt][1].red) /
@backgroundtone_c[bgt][3]
# Background Tone (Green)
@backgroundtone[bgt].viewport.tone.green =
(@backgroundtone[bgt].viewport.tone.green *
(@backgroundtone_c[bgt][3] - 1) +
@backgroundtone_c[bgt][1].green) /
@backgroundtone_c[bgt][3]
# Background Tone (Blue)
@backgroundtone[bgt].viewport.tone.blue =
(@backgroundtone[bgt].viewport.tone.blue *
(@backgroundtone_c[bgt][3] - 1) +
@backgroundtone_c[bgt][1].blue) /
@backgroundtone_c[bgt][3]
# Background Tone (Gray)
@backgroundtone[bgt].viewport.tone.gray =
(@backgroundtone[bgt].viewport.tone.gray *
(@backgroundtone_c[bgt][3] - 1) +
@backgroundtone_c[bgt][1].gray) /
@backgroundtone_c[bgt][3]