Convert colors in JavaScript from rgb to ryb and back