I have a CP437 tileset:
which I want to use as a CSS sprite on a webpage Currently, I have a very simple markup and css:
.tile {
display: inline-block;
width: 16px;
height: 16px;
}
.cp437-0 {
background: url('tileset/tileset.png') 0 0;
}
.cp437-1 {
background: url('tileset/tileset.png') 16px 0;
}
// ...
<span class="tile, cp437-0"> </span>
This works very well, but I'd also like to add color to these grayscale sprites. How can I do this with using HTML/CSS or Javascript?
Is it possible to set background color for the resulting image?
Clarification:
I'd like to be able to draw things like these to the browser window using the sprite: