85 @brief Function in charge of returning the code of the colour to use.
86 @param colour_class The class containing the colour definitions.
87 @param colour_name The name of the colour as a string.
88 @return The integer code of the colour, or None if the name is invalid.
90 if not isinstance(colour_name, str)
or not colour_name
or len(colour_name) == 0:
92 for i
in dir(colour_class):
93 if callable(getattr(colour_class, i)):
95 if colour_name == i.lower():
96 return getattr(colour_class, i)
102 @brief Function in charge of checking if the colour is present in the list of allowed colours.
103 @param colour_class The class containing the colour definitions.
104 @param colour_name The name of the colour as a string.
105 @return True if the colour is present, False otherwise.
107 if not isinstance(colour_name, str)
or not colour_name
or len(colour_name) == 0:
109 colour_name_lower = colour_name.lower()
110 for i
in dir(colour_class):
111 if callable(getattr(colour_class, i)):
113 if colour_name_lower == i.lower():