For today’s March Madness program I wanted to try to do something useful with the canvas tag. I decided it would be nice to be able to programmatically generate a background gradient for a web page based on the time of day. If you’re looking at the site in the morning the colors would be different from afternoon, sunset, midnight, etc. I created a hidden canvas tag to do my work and then used the toDataURL method to pass the resulting image to the body’s CSS. Source
