Question:
I need to blend from "purple" to "red" in a table cell, and I need to do it in web safe colors. Can I do that?
-submitted by Clarke Stone from The Saunders Group
Answer: Well,
There is only one way to do that without as far as I know, but
unfortunately
you can't have your cake and eat it too.
You must create an image and set it as a background image in the table.
You
can't get it *all* web safe. Gradients have so many different colors,
even
when they are just one or two colors. You can start the gradient with two
web safe colors, but they probably will be only safe on the ends. I
created
a gradient for a client and in AOL, normally blues, ended up with neon
green
running through it.
If you try in PhotoShop to do a normal black and white
gradient, then turn it to index colors using *Web* you will see it goes
from
hundreds of greys to four shades of grey, and then the black and white on
the ends.
To be honest, most people with browsers that could even see your
background, most likely would have a monitor that would be able to see the
gradient with all of its colors. If people are using 16 bit or higher, they
should be able to see the gradient without any problems. So unless your
users are in the dark ages, you should be able to use a normal .jpg or
.gif
direct from PhotoShop.
To set a table image as the background, you would have a td tag like this:
<TD background="images\yellow2dot.gif" bgcolor="#ffffcc"> I usually set
the
bg color to be similar to the image, so it let's people know there will be
something coming, or perhaps so they can read the text if it would be
impossible to read without the image that is to be loaded.
If you look at
the code at this page I used imbedded
tables
to be able to type in the center of the circle. Only the newer versions
of
IE and Netscape can view table backgrounds, and give up on trying to make
it
work in forms. Table backgrounds show up great on forms in IE, but not in
Netscape.
You can go to http://www.phoenix.net/~jacobson/pages/colorSel.html to get
the hex on the web safe colors, and if you need to convert them for RGB,
you
can go to http://www.phoenix.net/~jacobson/pages/hex.html#DectoHex to
convert them. Again, you can just pick two web safe colors, so they can
match your background or text perfectly, and just make a gradient with
those
two colors. 98% of the people should see it just fine....but remember,
gradients can be large in file size!
<<Back to Ask Us!