I'm writing a little application in Python.
I adopted tkinter for the UI and proceeded with the implementation, but the design is only reminiscent of Windows applications (such as VB) 20 years ago. .. ..
So I thought at least I wanted to make the colors look good, but I can't use RGB! ?? It seems that there is a constant for the color scheme peculiar to Tkinter. .. ..
I searched the list and hit this page: https://www.tcl.tk/man/tcl8.4/TkCmd/colors.htm
It is listed on a text basis, but it is very difficult to understand. Yes, let's make it easier to see!
I made it possible to check the color using Excel VBA. The result is an image, so for your reference.
https://www.zero-one-system.co.jp/wp-content/uploads/2020/06/tkinter_colors.png
As a result of various searches, after finishing making the above image, I found the following site: https://stackoverflow.com/questions/4969543/colour-chart-for-tkinter-and-tix
If you run the Python code, you can see everything.
It's a complete bonus, but I'll put it here.
VBA code:
GenerateColor.xlsm
Private Sub CommandButton1_Click()
'Variable definition
Dim n_row_st As Integer
Dim n_col_nm As Integer
Dim n_col_r As Integer
Dim n_col_g As Integer
Dim n_col_b As Integer
Dim n_col_bg As Integer
Dim i, n, m As Integer
'Variable setting
n_row_st = 5
n_col_nm = 2
n_col_r = 3
n_col_g = 4
n_col_b = 5
n_col_bg = 7
'Get background color from RGB and set
i = 0
Do Until Cells(n_row_st + i, n_col_nm).Value = ""
Cells(n_row_st + i, n_col_bg).Interior.Color = _
RGB(Cells(n_row_st + i, n_col_r).Value _
, Cells(n_row_st + i, n_col_g).Value _
, Cells(n_row_st + i, n_col_b).Value)
i = i + 1
Loop
'the end
Call MsgBox("OK")
End Sub
If anyone wants such VBA, please let us know in the comments. I will upload it somewhere.
Recommended Posts