Note that this isn't the best perf way of doing this. For better alternatives, check out the CSS variables or canvas versions.