Plain color conversion functions in JavaScript