Skip to content

Commit

Permalink
Read grid color from de.kutilek.MasterGrid.color
Browse files Browse the repository at this point in the history
  • Loading branch information
jenskutilek committed May 3, 2024
1 parent 0b9298a commit 93bc28f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion MasterGrid.glyphsReporter/Contents/Resources/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,9 @@ def start(self):
newMenuItem.setTarget_(self)
submenu = mainMenu.itemAtIndex_(2).submenu()
submenu.insertItem_atIndex_(newMenuItem, 12)
self.grid_color = Glyphs.defaults.get(
"%s.color" % plugin_id, (0.0, 0.0, 0.0, 0.1)
)

@objc.python_method
def background(self, layer):
Expand Down Expand Up @@ -234,7 +237,7 @@ def background(self, layer):
gx = upm / gx
gy = upm / gy

NSColor.lightGrayColor().set()
NSColor.colorWithCalibratedRed_green_blue_alpha_(*self.grid_color).set()
NSBezierPath.setDefaultLineWidth_(0.6 / self.getScale())

max_x = int(layer.width // gx + 2)
Expand Down

0 comments on commit 93bc28f

Please sign in to comment.