try {
int argb = java.awt.Color.HSBtoRGB
(StrictMath.max(0, StrictMath.min(255, ((Double) list.get(0)).intValue())) / 255,
StrictMath.max(0, StrictMath.min(255, ((Double) list.get(1)).intValue())) / 255,
StrictMath.max(0, StrictMath.min(255, ((Double) list.get(2)).intValue())) / 255);
LogoListBuilder hsbList = new LogoListBuilder();
hsbList.add(Double.valueOf((argb >> 16) & 0xff));
hsbList.add(Double.valueOf((argb >> 8) & 0xff));
hsbList.add(Double.valueOf(argb & 0xff));
return hsbList.toLogoList();
} catch (ClassCastException e) {
throw new org.nlogo.nvm.EngineException
(context, this, displayName() + " an rgb list must contain only numbers");
}
} else if (obj instanceof Double) {