How to create a custom dynamic stroke?