114 @brief Function in charge of returning the code of the colour to use.
115 @param colour_class The class containing the colour definitions.
116 @param colour_name The name of the colour as a string.
117 @return The integer code of the colour, or None if the name is invalid.
119 if not isinstance(colour_name, str)
or not colour_name
or len(colour_name) == 0:
121 for i
in dir(colour_class):
122 if callable(getattr(colour_class, i)):
124 if colour_name == i.lower():
125 return getattr(colour_class, i)
131 @brief Function in charge of checking if the colour is present in the list of allowed colours.
132 @param colour_class The class containing the colour definitions.
133 @param colour_name The name of the colour as a string.
134 @return True if the colour is present, False otherwise.
136 if not isinstance(colour_name, str)
or not colour_name
or len(colour_name) == 0:
138 colour_name_lower = colour_name.lower()
139 for i
in dir(colour_class):
140 if callable(getattr(colour_class, i)):
142 if colour_name_lower == i.lower():