This script shows how to convert ultima online colours and hues code into standard RGB values.
Written by @stiff forum, but i posted it here because he is too lazy
def hue2rgb(hue):
scale = 255 // 31
r = ((hue & 0x7c00) >> 10) * scale
g = ((hue & 0x03e0) >> 5) * scale
b = (hue & 0x001f) * scale
return (r, g, b)
hue = 1178
rgb = hue2rgb(hue)
Misc.SendMessage(f"Hue {hue} in RGB is {rgb}", hue)
The source used to make that function comes from the RE codebase:
https://github.com/RazorEnhanced/RazorEnhanced/blob/2ed41531488ffcf44474bf425db9ed90b28b939a/UltimaSDK/Ultima/Hues.cs#L161
public static int HueToColorR(short hue)
{
return (((hue & 0x7c00) >> 10) * (255 / 31));
}
public static int HueToColorG(short hue)
{
return (((hue & 0x3e0) >> 5) * (255 / 31));
}
public static int HueToColorB(short hue)
{
return ((hue & 0x1f) * (255 / 31));
}