TkWinfo.rgb

TkWinfo.rgb returns the code for the colour word. 

require “tk”

#working example to show the use of TkWinfo.rgb

p1 = [ ‘ ‘ , ‘ ‘]

p1[0,0] = TkWinfo.rgb(Tk.root ,”black”)
p1[0,1] = TkWinfo.rgb(Tk.root ,”white”)
p1[0,2] = TkWinfo.rgb(Tk.root ,”red”)
p1[1,0] = TkWinfo.rgb(Tk.root ,”green”)
p1[1,1] =TkWinfo.rgb(Tk.root ,”blue”)
p1[1,2] = TkWinfo.rgb(Tk.root ,”gray”)
#p1[2,0] = TkWinfo.rgb(Tk.root , “#0a0a0a”)

puts p1[0,0]
puts p1[0,1]
puts p1[0,2]
puts p1[1,0]
puts p1[1,1]
puts p1[1,2]

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: