converting ryb and
rgb is only a mathematical construct. the way to convert is by a color wheel or the cubic interpolation method. you need to have a look at what the javascript does, and why.
if you understood, how to transform ryb to
rgb you can possibly rearange the term for
rgb to ryb.
the 0..1 is because only the propotions count in ryb/cmy/cmyk (historical because of mixing paint)
the
rgb (0..255) is only because they are used for computerlanguage (hex) 00 to FF