Created
May 3, 2020 17:57
-
-
Save arrowtype/0b0c9bbef4be2eca821f3f92f941c46c to your computer and use it in GitHub Desktop.
RoboFont script to help set new mark opacity for a selected mark
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
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