def rgb(r, g, b):
    """
    Converts RGB decimal values to hexadecimal.
    :param r: integer value.
    :param g: integer value.
    :param b: integer value.
    :return: hexadecimal version of RGB decimal numbers.
    """
    return "".join(["%02X" % max(0, min(x, 255)) for x in [r, g, b]])