Function to convert the RGB code to Hex color code
def convertRGBtoHex ( R , G , B ) : NEW_LINE INDENT if ( ( R >= 0 and R <= 255 ) and ( G >= 0 and G <= 255 ) and ( B >= 0 and B <= 255 ) ) : NEW_LINE INDENT hexCode = hexCode + decToHexa ( R ) NEW_LINE hexCode = hexCode + decToHexa ( G ) NEW_LINE hexCode = hexCode + decToHexa ( B ) NEW_LINE return hexCode NEW_LINE DEDENT else : NEW_LINE DEDENT