Use SASS to accomplish this. Simply install ruby and then run:
gem install SASS
sass --watch /path/to/sass path/to/css
This will watch and convert any SASS files in the first directory to CSS in the second directory. You can then use functions in the SASS to handle lightening and darkening of colors with variables. A quick example:
@black: #000;
footer {
background-color: lighten(@black, 20%);
}
and it will render completely valid CSS using ruby to handle the variables and lightening of the background by 20%