How to access custom node colour

In my reporter plugin, I want to highlight on-curve nodes in the same colour but some users may have changed the default. How can I access the custom node colours that are set in the Preferences?

1 Like

Those values are stored in UserDefaults.
Here is a list of the keys that from the preference window.

  • GSFontViewWidth
  • GSHandleSize
  • GSColorNodeCorner
  • GSColorNodeSmooth
  • GSColorZones
  • GSColorKerningNegative
  • GSColorKerningPositive
  • GSColorBackground
  • ImportKeepGlyphsNames
  • ImportDisableAutomaticAlignment

To get the NSColor from the user defaults:

colorData = Glyphs.defaults["GSColorNodeCorner"]
color = NSUnarchiver.unarchiveObjectWithData_(colorData)
1 Like

how can I change the default?

correcting, I know that there are those choices on preferences, but I would like to change selected/unselected point with filled points all the time, not outline when the point is not selected

Not quite sure what you mean. But you can take full control of the complete appearance with your own reporter plugin.


Also wondering if there’s a way to get the actual displayed stroke color, as it changes depending on the background color (#darkmode).

Would be great to offer a way, or even an API, so plugins can attach themselves to some colors in order to keep the display clean :slightly_smiling_face: Thinking for example of text, which needs to stand out from the background.

That’s what semantic colors are for. NSColor.textColor() for instance and so on. They adapt to the current display mode.

I thought about that, but I wasn’t aware that the adapt, because by definition they adapt to dark mode in the OS, but you can have a dark background color in Glyphs even in Light mode …

You can try this: