The omniJS API docs suggest that the .hue getter should return a correct value from a Color created with the Color.RGB constructor (converting the color value to an HSB color space).
I may be misunderstanding, but it looks to me as if that conversion is failing at the moment.
If I create every one of the 100+ HTML colors with Color.RGB, and then read their .hue value, all hue values are returned as either 0.5 or 1.0 - i.e. where we might expect to see at least 8 bits of information we only see one.
A similar result is obtained from the following code, which tries every Red value from 0 to 255, and only ever gets a hue of 0.5 or 1.0
(() => {
'use strict';
// enumFromTo :: Int -> Int -> [Int]
const enumFromTo = (m, n) =>
Array.from({
length: Math.floor(n - m) + 1
}, (_, i) => m + i);
// map :: (a -> b) -> [a] -> [b]
const map = (f, xs) => xs.map(f);
// show :: Int -> a -> Indented String
// show :: a -> String
const show = (...x) =>
JSON.stringify.apply(
null, x.length > 1 ? [x[1], null, x[0]] : x
);
return show(
map(
r => Color.RGB(r / 255, 0.5, 0.5)
.hue,
enumFromTo(0, 255)
)
);
})();
We get a similar result if we map over:
all of the Green values 0-255 (all green levels are collapsed to .hue values of either .3333 or .8333)
all of the Blue values (all collapsed to just two .hue values - .1666 or .6666)
(Note that the .hue getter does return correct values with Colors constructed by Color.HSB - so I would guess that the other 7 bits of color information are getting lost in the conversion)
Or, for a more direct example, which does appear to confirm a conversion failure, if we look up the RGB and HSB for HTML yellowGreen, we will find:
RGB 154 205 50
HSB 0.778 0.756 0.804
but the .hue.saturation and .brightness getters are returning something with quite a different Hue (0.222, 0.756, 0.804 ) where we expected ( 0.778, 0.756, 0.804).