0

I have a RGB color with the following specifications: R = 62, B = 120, G = 70

Is there a way in Python to generate one pixel of this specific RGB color in order to be able to see what the color looks like ?

ᴀʀᴍᴀɴ
  • 4,443
  • 8
  • 37
  • 57
gus
  • 103
  • 8

2 Answers2

2

One pixel doesn't seem like it would be visible enough. How about a small window full of the color?

color = (62, 70, 120)
from Tkinter import Tk    # lower case T if you're using Python 3.x
root = Tk()
root['bg'] = "#%02x%02x%02x" % color
root.mainloop()
jasonharper
  • 9,450
  • 2
  • 18
  • 42
0

Assuming your talking about a console application, that's possible on linux based OS. You would basically instruct the shell to "Add some color", using what's called "ANSI escape sequences", i.e. a special sequence of characters that will be interpreted as coloration.

See: Print in terminal with colors using Python?

Community
  • 1
  • 1
Adrien Leravat
  • 2,731
  • 18
  • 32