your machine. Give me about 30 minutes to figure that out.
# this is just a test scaffolding to try different things
#
# snippet.py
#
#from statistics import geometric_mean
#---------------------------------------------------
import math
from tkinter import Button, Canvas, Label, Tk
from tkinter.colorchooser import askcolor
from tkinter.ttk import Sizegrip
from rich.console import Console
#
#----------------------------------------
root = Tk()
root.geometry("400x400")
root.resizable(True, True)
ReferenceChartPath = "reference color chart.jpg"
root.iconbitmap( ReferenceChartPath )
canvas = Canvas( width=400 , height=400)
canvas.grid(columnspan=10, rowspan=10 )
#l1 = tkinter.Label(text="Test", fg="black", bg="white")
AnswerLabel=Label( root, text="Your Decimal Number Will appear here", fg="white", bg="blue", border=3)
AnswerLabel.grid( row=2, column=0)
#-------------------------------------------------
sg=Sizegrip(root)
sg.grid(row=10, sticky="SE")
#----------------------------------------------------
def choose_color():
console=Console()
#console.log("\n line 29 Inside choose_color()\n")
ColorChosen = askcolor(title="Color Chooser")
DecimalNumber = ColorChosen[1]
#console.log("\n line 33 DecimalNumber= "+str(DecimalNumber))
# strip off the "#" character from the colorchooser
'''
str.replace(old, new[, count])
Return a copy of the string with all occurrences of substring old replaced by new. If the
optional argument count is given, only the first count occurrences are replaced.
'''
TempString = DecimalNumber.replace("#", "0x", 1)
#console.log("\n line 37 TempString= "+str(TempString))
DecimalNumber=TempString
#console.log("\n line 40 DecimalNumber= "+str(DecimalNumber))
dec_num = int(DecimalNumber,16)
#console.log("\n line 44 dec_num= " + str(dec_num) + "\n")
# TODO: some processing on the color we've calculated
# I gotta find a way to update the AnswerLabel's text attribute
AnswerLabel.config(text = str(dec_num))
#
#----------------------------------------------
GenericButton = Button( root, text="Pick your color")
GenericButton.config( activebackground="blue",
activeforeground="white",
background="blue",
bg="blue",
fg="white",
borderwidth="3",
command=choose_color)
GenericButton.grid(row=0, column=0)
#---------------------------------------------------
#
root.mainloop()
#
#-------------------------------------







