![]() ![]() def colorize ( self, text : str, bg : Union = 0, fg : Union = 0, bold : bool = 0, underline : bool = 0, ) -> str : """Returns a string with the ANSI color codes for the given parameters. Raises: self.unknownColor: Raised when the color is not found. Args: color (str): The color to return the code for. def returnColor ( self, color : str, kind : str ) -> int : """Returns the color code for the given color. def _init_ ( self ): """Initializes the Colors class.""". """ class unknownColor ( Exception ): """The unknown color class, this exception is raised when a color is not found.""". Usage - from lorize import Colors colors = Colors() message = lorize('Hello World!', fg='green', 'bg'='indigo', 'bold'=True) All Colors - Foreground - ・gray - 30 ・red - 31 ・green - 32 ・yellow - 33 ・blue - 34 ・pink - 35 ・cyan - 36 ・white - 37 Background - ・darkBlue - 40 ・orange - 41 ・gray - 46 ・lightGray - 43 ・lighterGray - 44 ・indigo - 45 ・white - 47 Formatting - ・bold - 1 ・underline - 4 ・default - 0 Both the names of colors and styles (bold, gray, darkBlue, etc), and their integer equivalents (1, 30, 40) are accepted as valid inputs for colorization. Colors )Ĭreated by TheOnlyWayUp#1231 - class Colors : r """Represents the class used for normal strings to Discord ANSI Codeblocks that support colors. ![]() Colors () data = f """ ```ansi ``` """ help ( discord_colorize. Usage - import discord_colorize colors = discord_colorize. You can do help(discord_colorize.Colors) to see all the available colors along with a detailed docstring on how to use the package. Colored Codeblocks for Discord Bots using ANSI Escape Sequences. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |