@verb #8084:"16bit_to_8bit" none none none rxdo #8084 @program #8084:"16bit_to_8bit" none none none "By converting through a ratio, converts a 16bit hex color to an 8 bit one. This can be done easier by just taking the first two characters of the 16 bit hex for each color. But this is proof that that works. ;)" {red, green, blue} = args red8 = $math_utils:base_conversion(toint(tofloat($math_utils:base_conversion(red, 16, 10)) / 2.0 ^ 16.0 * 255.0), 10, 16) green8 = $math_utils:base_conversion(toint(tofloat($math_utils:base_conversion(green, 16, 10)) / 2.0 ^ 16.0 * 255.0), 10, 16) blue8 = $math_utils:base_conversion(toint(tofloat($math_utils:base_conversion(blue, 16, 10)) / 2.0 ^ 16.0 * 255.0), 10, 16) return tostr("#", red8, green8, blue8) "Last modified by Dax (#789) on Tue May 3 14:11:59 2005 MDT." .