How can I change the color of fillable squares in GNOME Sudoku 3.4.1 on Ubuntu 12.04 to anything less "white"?

2

0

I play Sudoku on my laptop but I find that the white color of the blank squares that we have to fill is hurtful to my eyes. I would like to change the color to something less white, say #777777.

I have tried to edit gtk.css, gtk-widgets.css, and settings.ini in my Ambiance theme to no avail. I assume that Sudoku is gtk3.

I do not know programming but I don't mind editing text files if that will solve my issue. So, if the solution doesn't require editing source code, I'll be grateful for any guidance.

user151227

Posted 2012-08-09T06:35:00.273

Reputation:

Answers

0

Unfortunately, you can not change the color with ~/.config/gtk-3.0/gtk.css, or any other easy way, as you could in other widgets. If you need, you must change the source code like this:

--- /usr/lib/python2.7/dist-packages/gnome_sudoku/number_box.py~        2012-08-14 19:45:16.000000000 +0900
+++ /usr/lib/python2.7/dist-packages/gnome_sudoku/number_box.py 2012-08-14 19:41:41.000000000 +0900
@@ -571,7 +571,7 @@
             #    self.style.base[self.state]
             #    )
             #Gdk.cairo_set_source_rgba(
-            cr.set_source_rgb(1.0, 1.0, 1.0)
+            cr.set_source_rgb(0.9, 0.9, 0.9)
         cr.rectangle(
             0, 0, w, h,
             )

Note that:

  • you can control the color with three values representing RGB; the sample diff above is changing 1.0s to 0.9s.
  • This sample diff is for python 2.7. If you are using python3 as your default python, change the directory, accordingly.
  • If you upgrade your gnome-sudoku package, it will revert the change.
  • The reason you can not control them with gtk.css is that they are GtkDrawingAreas with the custom drawing method and literal rgb value (shown in the above diff).

Hope this helps.

Yasushi Shoji

Posted 2012-08-09T06:35:00.273

Reputation: 686