Perhaps try to separate the colors into 10 buckets instead of 100, then make a list out of it.
colors = ["#first", "#second", "#third", ..., "#tenth"]
Then, write a simple function to assign the number to the corresponding color.
def pick_color(num):
if num in range(0, 10):
return colors[1]
elif num in range(10, 20):
return colors[2]
...and so on.
Answer from mysl on Stack OverflowPerhaps try to separate the colors into 10 buckets instead of 100, then make a list out of it.
colors = ["#first", "#second", "#third", ..., "#tenth"]
Then, write a simple function to assign the number to the corresponding color.
def pick_color(num):
if num in range(0, 10):
return colors[1]
elif num in range(10, 20):
return colors[2]
...and so on.
In Pandas, you can use the following code to get the picture attached. You will need Pandas, Numpy for rounding, and you may need Matplotlib as well.
(np.round(df.corr().iloc[:-1, :], 6).style.format({})
.background_gradient(cmap='RdYlGn', low=.4, high=.4))

Python: Retrieving color codes from a number input by user - Stack Overflow
Syntax Highlighting in Discord
How does the "color code" for bot embeds work?
The color parameter is a hexadecimal code converted to decimal. Most programming languages will do this conversion for you if you prefix the hex code with 0x.
pygame.Color(name) -- the list of 657 names you can use
This is easily acessible via the constant color.THECOLORS
>>> from pprint import pprint >>> import pygame as pg >>> >>> pprint(pg.color.THECOLORS)
In general I do believe you will find these follow the allowable html color conventions:
https://htmlcolorcodes.com/color-names/