Discussion:
good way to choose 15 colors? Or 20, more? (adjacent colors should look different)
(too old to reply)
HenHanna
2024-07-02 14:49:59 UTC
Permalink
black= (0,0,0)
white= (255,255, 255)
blue= (0, 0, 128)
pink= (245, 182, 193)
green= (0, 128, 0)
gray= (105,105, 105)
red= (128, 0,0)
yellow= (255, 255,0)
cyan= (0, 255, 255)
magenta= (255,0, 255)
purple= ( 160, 32, 240) ------------------ that's 11 colors


What's a good way to choose 15 colors? Or 20 colors? Or more?

(adjacent colors should look different)
DFS
2024-07-02 17:27:21 UTC
Permalink
Post by HenHanna
black= (0,0,0)
white= (255,255, 255)
blue= (0, 0, 128)
pink=  (245, 182, 193)
green= (0, 128, 0)
gray= (105,105, 105)
red= (128, 0,0)
yellow= (255, 255,0)
cyan= (0, 255, 255)
magenta= (255,0, 255)
purple= ( 160, 32, 240)  ------------------  that's 11 colors
What's a good way to choose 15 colors?   Or 20 colors?  Or more?
1) choose from lists of predefined colors
https://www.rapidtables.com/web/color/RGB_Color.html
https://www.w3schools.com/html/html_colors_rgb.asp
Loading Image...

2) predefine and name your own colors manually, then pick the colors at
random from a list

3) generate random r,g,b values between 0 and 255, and name the
resultant colors.

4) generate r,g,b values in ranges known to produce greens, reds, blues,
oranges, yellows, etc. You could name them consecutively: green1,
green2, green3...
Post by HenHanna
  (adjacent colors should look different)
What are 'adjacent colors'?
HenHanna
2024-07-02 19:49:18 UTC
Permalink
Post by DFS
Post by HenHanna
black= (0,0,0)
white= (255,255, 255)
blue= (0, 0, 128)
pink=  (245, 182, 193)
green= (0, 128, 0)
gray= (105,105, 105)
red= (128, 0,0)
yellow= (255, 255,0)
cyan= (0, 255, 255)
magenta= (255,0, 255)
purple= ( 160, 32, 240)  ------------------  that's 11 colors
What's a good way to choose 15 colors?   Or 20 colors?  Or more?
1) choose from lists of predefined colors
https://www.rapidtables.com/web/color/RGB_Color.html
https://www.w3schools.com/html/html_colors_rgb.asp
https://excelatfinance.com/xlf/media/xlf-colindx2ws.png
2) predefine and name your own colors manually, then pick the colors at
random from a list
3) generate random r,g,b values between 0 and 255, and name the
resultant colors.
4) generate r,g,b values in ranges known to produce greens, reds, blues,
oranges, yellows, etc.  You could name them consecutively: green1,
green2, green3...
Post by HenHanna
  (adjacent colors should look different)
What are 'adjacent colors'?
black= (0,0,0)
white= (255,255,255) .............

from PIL import Image
from PIL import ImageDraw

def newImg():
img = Image.new('RGB', (120, 120))

for i in range(100):
img.putpixel((10+i,10+i), (red, black, white)[i%3])

img.save('test.gif')
return img




Thanks.... for what i mean by [adjacent] pls see above.




............good ways to choose 15, 20, or more colors in Python,
ensuring adjacent colors look different:

1. Colormaps:

Import libraries:

Python
import matplotlib.pyplot as plt
from matplotlib.cm import get_cmap

Choose a colormap:

There are many built-in colormaps in Matplotlib. Some that provide good
visual distinction between adjacent colors include:

viridis

plasma

inferno

cividis

coolwarm (for diverging color schemes)
Lawrence D'Oliveiro
2024-07-02 21:41:12 UTC
Permalink
Post by HenHanna
What's a good way to choose 15 colors? Or 20 colors? Or more?
(adjacent colors should look different)
Something like this
<https://www.deviantart.com/default-cube/art/Related-Colours-726210156>,
perhaps?
HenHanna
2024-07-03 03:12:59 UTC
Permalink
Post by Lawrence D'Oliveiro
Post by HenHanna
What's a good way to choose 15 colors? Or 20 colors? Or more?
(adjacent colors should look different)
Something like this
<https://www.deviantart.com/default-cube/art/Related-Colours-726210156>,
perhaps?
thanks... i'm surprised what i'm looking for isn't offered as default.


(10 default colors at)
https://matplotlib.org/stable/gallery/color/color_cycle_default.html

e.g. i want to get 50 colors like this:

(10 default colors)

(10 default colors) a little darker (and rotated in the Color wheel)

(10 default colors) a little lighter (and -rotated in the Color wheel)

(10 default colors) darker still (and rotated in the Color wheel)

(10 default colors) lighter still (and -rotated in the Color wheel)



darker/lighter (and rotation?) doesn't work for Black/White, does it?
Loading...