Skip to content

Instantly share code, notes, and snippets.

@arrowtype
Created May 3, 2020 17:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arrowtype/0b0c9bbef4be2eca821f3f92f941c46c to your computer and use it in GitHub Desktop.
Save arrowtype/0b0c9bbef4be2eca821f3f92f941c46c to your computer and use it in GitHub Desktop.
RoboFont script to help set new mark opacity for a selected mark
"""
Get the mark color of currently-selected glyphs and change the
opacity of it in the current font.
Useful for changing the Font View to a "dark theme," where
the wrong mark opacity can suddenly disrupt a system of colors.
"""
f = CurrentFont()
markOpacity = 0.375
colorToEdit = f[f.selection[0]].markColor
newColor = tuple([c[1] for c in enumerate(colorToEdit) if (c[0] < 3)] + [markOpacity])
print(newColor)
for g in f:
if g.markColor == colorToEdit:
g.markColor = newColor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment