skishore / makemeahanzi

Free, open-source Chinese character data
https://www.skishore.me/makemeahanzi/
Other
1.87k stars 466 forks source link

Fill the stroke with a color gradient based on the stroke animation direction #111

Closed myarcana closed 1 year ago

myarcana commented 1 year ago

I would like the fill color of a stroke to be a gradient that processes in the same direction the stroke animation would (the stroke's writing direction).

How can this be done? Are graphics.txt's medians enough information for that (I don't quite understand what medians are based on the README)?

myarcana commented 1 year ago

medians seem to be the "turning points" of strokes, and describe the direction the stroke was drawn in. Here are the medians plotted on a character:

Screenshot 2023-01-08 at 14 43 44

Drawing a gradient based on the medians using SVG features alone should be possible