Ask coding questions

← Back to all posts
What are all the color options?
LillyTulips (5)

I tried googling but some colors work some done, for this website where can I learn all the available colors. Like I saw someone else use "cornsilk" I never would have guessed that's a color!. Where do you learn all these colors?
-Thank you

Answered by Coder100 (18192) [earned 5 cycles]
View Answer
Comments
hotnewtop
Coder100 (18192)

There are 3 ways to make colors.

Name

color: blue;
https://www.w3schools.com/colors/colors_names.asp
https://www.cssportal.com/css3-color-names/
https://www.rapidtables.com/web/css/css-color.html
https://www.tutorialrepublic.com/css-reference/css-color-names.php

Hex

You will have to use a colorpicker for this,
color: #f00;

RGB

Use a colorpicker.
color: rgba(255, 0, 0, 0.5);

HSL

Use a colorpicker
color: hsl(0, 100%, 50%);

LillyTulips (5)

thankyou this is exactly what I [email protected]

Bookie0 (6286)

hey there!

wdym by color options? if you mean how to colors text:

you can use ansi escape codes to color text in the console; here are some colors you can use in Python:

You can also have colors in python:

# the ANSI codes are stored in variables, making them easier to use
black = "\033[0;30m"
red = "\033[0;31m"
green = "\033[0;32m"
yellow = "\033[0;33m"
blue = "\033[0;34m"
magenta = "\033[0;35m"
cyan = "\033[0;36m"
white = "\033[0;37m"
bright_black = "\033[0;90m"
bright_red = "\033[0;91m"
bright_green = "\033[0;92m"
bright_yellow = "\033[0;93m"
bright_blue = "\033[0;94m"
bright_magenta = "\033[0;95m"
bright_cyan = "\033[0;96m"
bright_white = "\033[0;97m"


# to use them:
print(red+"Hello")

# you can also have multiple colors:
print(red+"Hel"+bright_blue+"lo")


# you can also use bold and underline

reset = "\u001b[0m"
underline = "\033[4m"
italic = "\033[3m"

# to use it:

print(italic+"Hello "+reset+" there "+underline+"Mister!")
# the reset is for taking away all changes you've made to the text
# it makes the text back to the default color and text decorations.

if you mean what are all the colors in the world, then we have about 10 million:

First of all, scientists have determined that in the lab we can see about 1,000 levels of dark-light and about 100 levels each of red-green and yellow-blue. So that's about 10 million colors right there.

(from here: https://www.azcentral.com/story/opinion/op-ed/claythompson/2015/12/14/how-many-colors-are-there/77311176/#:~:text=First%20of%20all%2C%20scientists%20have,10%20million%20colors%20right%20there.)

but you can also use a hex color picker to get many many many colors:

https://www.google.com/search?q=hex+color+picker&oq=hex+color+picker&aqs=chrome..69i57j35i39j0l6.1478j0j7&sourceid=chrome&ie=UTF-8

to find the available colors to use in CSS, you can just put the hex number or put the name: https://www.w3schools.com/colors/colors_picker.asp
https://www.w3schools.com/w3css/w3css_colors.asp

And if you need some good colors that go well with each other: https://coolors.co/