You can specify the color with a hexadecimal system or a regular decimal system. An example that uses a hexadecimal system
BODY {background-color:#FF00FF;}
and an example that uses a decimal system
BODY {background-color:rgb(51,0,102)}
The definition of rgb (255,255,255) represents white, the code rgb (0,0,0) represents black.
So how can you make the fade effect? Well, the easiest way is to use the decimal method:
<script type="text/javascript"> var red = 255; var green = 255; var blue = 255; var interVal = window.setInterval("fadeEffect()", 1000); function fadeEffect() { if (red > 0 && green > 0 && blue > 0) red--; if (red == 0 && green > 0 && blue > 0) green--; if (red == 0 && green == 0 && blue > 0) blue--; if (red == 0 && green == 0 && blue == 0) window.clearInterval(interVal); </script>
I hope he answers your question or helps you come up with your idea. If you want to use hexadecimal numbers, you had to convert to hexadecimal code before you created a new argument.
source share