fix QTextEdit not clearing properly, use minimum contrast in initial client color selection, MINIMUM_CONTRAST constant

This commit is contained in:
Xevion
2021-01-20 23:36:23 -06:00
parent fd7cf3bdec
commit 76ec0fd75b
4 changed files with 4 additions and 2 deletions

View File

@@ -70,7 +70,7 @@ class CommandHandler:
logger.error(f'Could not process client {self.client.nickname}\'s command request.', exc_info=e)
return 'A fatal error occurred while trying to process this command.'
def reroll(self, minimum_contrast: float = 4.65) -> str:
def reroll(self, minimum_contrast: float = constants.MINIMUM_CONTRAST) -> str:
"""
Randomly change the client's color to a different color.
"""

View File

@@ -26,7 +26,7 @@ class Client:
self.id = str(uuid.uuid4())
self.nickname = self.id[:8]
self.color = random.choice(constants.Colors.ALL)
self.color = random.choice(constants.Colors.has_contrast(float(constants.MINIMUM_CONTRAST)))
self.command = CommandHandler(self)
self.first_seen = time.time()