Set stroke parameter as a function