def rgb_to_color(r, g, b):
    """Convert R, G, B values to hex string."""
    r, g, b = int(r) & 0xFF, int(g) & 0xFF, int(b) & 0xFF
    value = r << 16 | g << 8 | b
    return '0x{0:06X}'.format(value)