Forum Moderators: open
But, when I started using CSS about four months ago, and needed to use hex colors, I found myself getting back into FrontPage for the sole purpose of using the hex color chooser.
However, that's very cumbersome, and I'd rather be able to simply say, "Oh, I'd like a light blue, I'll try cceeff." So my question is, how do you just find the hex color you want, without needing to use some visual aid?
Otherwise... It's not THAT hard to get used to interpreting hex codes. Just remember that there are 16 digits (0-9A-F) and that the first two adjust the amount of red, the next two the amount of green, and the last two the amount of blue.
Hex goes from 0-9, then A-F. So when you get to 9, you don't carry the number over (as in 10), but you continue through A-F. When you get to 'F', then it carries over, so you add one to the digit in front and reset the one you have been incrementing (so it becomes 10). We do the same in decimal, but add and reset after 9 instead of F.
Therefore the maximum is 'FF' for a 2 digit colour. They are in the format RRGGBB. (Red, Green, Blue). So, FF0000 is red (all red on full, green and blue switched off).
Web safe colours generally have the values: FF, CC, 99, 66, 33 or 00. Using these, you will be able to get close, if you experiment a little, you'll soon get the hang of it. So, if you know you need bright red, medium blue, but zero green in your colour you could jump straight into FF0066.
If you've messed with RGB colours before, you'll get the idea quite quickly.
__FFCC99663300 -> Red
FF
CC
99
66
33
00
Green
Greetings,
Herenvardö
They are ugly!
I mean, you pretty much presume your visitors will be able to show some .jpg or .gif decently right? They (usually) use a much broader palet. So why restrict yourself to these bland "websafe colors" for text or whatever?
The same happens if you choose a non-web-safe colour over a large area. Sometimes the two colours it picks can be quite different and look awful. Put any text over that, and it can become very difficult to read it.
Web safe colours should be used for the fundemental colours on a site, whereas non-websafe colours should only be used in small areas, such as graphics.
There are only 216 web safe colors. Every third hex number gives 6x6x6 = 216. If it were every hex color you'd have 16x16x16 = 4096 colors.
If you want to get a intermediate color, do it by arithmetics. For example: Orange is 50% Yellow + 50% Red, so you can make 0.5x#FF0 + 0.5x#F00 = #F80 ~ #F90 -> Orange
Remember to use only 0, 3, 6, 9, C and F if you want web-safe colors.
Greetings,
Herenvardö
<table border=0 cellpadding=2 cellspacing=2 width=100%>
<script type="text/javascript">
<!--
var r = 0;
var g = 0;
var b = 0;
var hexs = new Array(6);
hexs[0] = "00";
hexs[1] = "33";
hexs[2] = "66";
hexs[3] = "99";
hexs[4] = "CC";
hexs[5] = "FF";
for(r = 0; r < 6; r+=1)
{
for(g = 0; g < 6; g+=1)
{
document.write("<tr>");
for(b = 0; b < 6; b+=1)
{
hexstr = hexs[r] + hexs[g] + hexs[b];
document.write("<td bgcolor='#"+hexstr+"'>"+hexstr+"</td>");
}
document.write("</tr>");
}
}
//-->
</script>
</table>
Ok, I'm just showing off ;)
You can style the text inside cell with the inverse colour
I can't quite make this work. But there is another simple alternative. Place the text inside a span whose background-color is set to white.
document.write("<td bgcolor='#"+hexstr+"'><span style=background-color:#fff>"+hexstr+"</span></td>"); (You may also find this consistent black-on-white more readable and less distracting.)