def convert_to_RGB_255(colors):
 rgb_components = []
 for component in colors:
  rounded_num = decimal.Decimal(str((component * 255.0))).quantize(decimal.Decimal('1'), rounding=decimal.ROUND_HALF_EVEN)
  rounded_num = int(rounded_num)
  rgb_components.append(rounded_num)
 return (rgb_components[0], rgb_components[1], rgb_components[2])

def convert_to_RGB_255 ( colors ) : rgb_components = [ ] for component in colors : rounded_num = decimal . Decimal ( str ( ( component * 255.0 ) ) ) . quantize ( decimal . Decimal ( '1' ) , rounding = decimal . ROUND_HALF_EVEN ) rounded_num = int ( rounded_num ) rgb_components . append ( rounded_num ) return ( rgb_components [ 0 ] , rgb_components [ 1 ] , rgb_components [ 2 ] )
multiplies each element of a triplet by 255 each coordinate of the color tuple is rounded to the nearest float and then is turned into an integer .