tags:

views:

81

answers:

1

Hi there

I'm trying to use some sort of "darker than" or "lighter than" tag in my CSS page definitions... Is there any such a thing, or do people have a suggestion of a way that one could do this?

Thanks, jml

+4  A: 

Technically, no...

No, you'll have to explicitly declare a color. You could jump into photoshop and copy the hex of your favorite color from the color-palette.

But if you're really smooth, you can...

One other option to simulate shades is to use transparent png files, and setting them as the background image over the top of a background color.

.red       { background-color:red; }
.darkerRed { background:red url("fiftyPercentOpaqueBlack.png"); }

And now for an example...

For example, the .png below is actually solid black, with an opacity of 50% which creates a shade of grey when viewed on top of white, or #ffffff.

alt text

Jonathan Sampson
hmm; that's interesting.i'll check into it if i get really desperate. :)for now, i think that the rgb() call will work... i also don't mind looking up colors individually.i had an idea about it where i could just build the color scheme in a program like illustrator or whatnot and then somehow copy the schem over...
jml
this certainly seems like a viable option if you are embarking on a larger project. for my specific needs it seems like overkill as i'm just trying to change text colors...
jml