Colors are duplicated?

18 views
Skip to first unread message

Matt

unread,
Oct 11, 2022, 11:56:55 AM10/11/22
to qtile-dev
I am new to WMs and I had a question regarding to the config.py file where they specifiy the color theme. In most example configs I see, they create a list, with 'x' amount of nested lists repeating the same colors in the nested lists. e.g.

def init_colors():
return [["#2F343F", "#2F343F"], # color 0
["#2F343F", "#2F343F"], # color 1
["#c0c5ce", "#c0c5ce"], # color 2
["#fba922", "#fba922"], # color 3
["#3384d0", "#3384d0"], # color 4
["#f3f4f5", "#f3f4f5"], # color 5
["#cd1f3f", "#cd1f3f"], # color 6
["#62FF00", "#62FF00"], # color 7
["#6790eb", "#6790eb"], # color 8
["#a9a9a9", "#a9a9a9"]] # color 9

Why are these colors duplicated?
Thank You,
M

James Wright

unread,
Oct 11, 2022, 12:40:17 PM10/11/22
to qtil...@googlegroups.com
It looks like if you give a list of two colors to the drawer (backend/base.py:Drawer), it will create a linear gradient from one color to the other (see the 'set_source_rgb' method for base.Drawer). Note that you don't have to do this; you can just pass in a single color if you want.

James Wright


--
You received this message because you are subscribed to the Google Groups "qtile-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to qtile-dev+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/qtile-dev/172247af-0f3f-4f7b-878e-74149f01bb21n%40googlegroups.com.

Matt

unread,
Oct 11, 2022, 12:42:06 PM10/11/22
to qtile-dev
Ahhh......... Got it. Thank you very much.

I don't need gradients so I can just make a single list of colors.

Thanks again.

James Wright

unread,
Oct 11, 2022, 12:56:33 PM10/11/22
to qtil...@googlegroups.com
Also, note that a color pair *must* be a list in the current implementation (backend/base.py#824). That should probably be changed to checking for a Sequence (excluding strings), but that's a minor issue.



Matt

unread,
Oct 11, 2022, 1:00:01 PM10/11/22
to qtile-dev
Yes, I already changed it to:

colors = [["#2F343F", "#2F343F"], # color 0
               ["#2F343F", "#2F343F"], # color 1
               ["#c0c5ce", "#c0c5ce"], # color 2
               ...
I will be refactoring a lot of things after I get familiar with the WM

Thanks 
Reply all
Reply to author
Forward
0 new messages