Fix Member.colour to use the new algorithm for determining colour.
This commit is contained in:
		| @@ -117,12 +117,19 @@ class Member(User): | |||||||
|         There is an alias for this under ``color``. |         There is an alias for this under ``color``. | ||||||
|         """ |         """ | ||||||
|  |  | ||||||
|  |         default_colour = Colour.default() | ||||||
|         # highest order of the colour is the one that gets rendered. |         # highest order of the colour is the one that gets rendered. | ||||||
|  |         # if the highest is the default colour then the next one with a colour | ||||||
|  |         # is chosen instead | ||||||
|         if self.roles: |         if self.roles: | ||||||
|             role = max(self.roles, key=lambda r: r.position) |             roles = sorted(self.roles, key=lambda r: r.position, reverse=True) | ||||||
|             return role.colour |             for role in roles: | ||||||
|         else: |                 if role.colour == default_colour: | ||||||
|             return Colour.default() |                     continue | ||||||
|  |                 else: | ||||||
|  |                     return role.colour | ||||||
|  |  | ||||||
|  |         return default_colour | ||||||
|  |  | ||||||
|     color = colour |     color = colour | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user