Monday, January 2, 2023

Project

 Have to admit I was really taken by thatTurtle color mixer demo.

Much fun, but not really helptful in an actual work situation. We need

to read the color value, and make it reproductible.


That demo was done in 2006. Python has advanced since then with tkinter, although 

it still only accepts color names or hex values as one codes. Not really 

a problem; one can go from hex to rgb easily enough. Hex colors are base 16,

rather than base 10. Below, a patch of Saxon blue HEX #657F84 from

Pantone. How to get the red-green-blue value:


The first two digits are the red value. Thus,

(6 x 16) + 5 = 101

The second two, green (the letters go from A for 10):

(7 x 16) + 15 = 127

The third two, blue:

(8 x 16) + 4 = 132

Works like that everywhere. The computer will 'do something' for a

definite number of color calls, but that's it.


                                                             


 

Here, on Microsoft Expression Design:

                                                                      


So that is the project I am starting today: an updated color mixer that shows

the rgb color values as one moves Turle. (Probably, with the ttk Scale widget.)

                                                                *     *     *

Actually, all this can be made to work in a very straightforward fashion.

I"ve copied the colormixer code to pycharm. and I added a simple command to

print out the coordinates of the three turtles as I go along. A check with the opening

screen when all thee are immobile shows I am indeed creating a (128, 128, 128)

background!




                                                                               

                                                                                        


No comments: