Can anyone help with me understanding the purpose of this function?
Does anyone have a real life example of a time they implemented it?
I understand the example given but I cant see a real world need to rename opacity to transparency so I am sure there are some real problems that it can solve?
The example given in the docs does more than remap the name of opacity - it inverts the value. The example could be more interesting, as
transformalso takes athemeandthemeKey. I made a more involved example that uses these. So, for a value ofprogressfrom 0-1, you get one color for your simple theme, a shade of yellow for your dark theme, and a shade of blue for your light theme.So it's basically a more powerful tool to create aliases/abbreviations (restyled is riddled with these), which also allows you to transform the value, potentially based on your chosen theme. I doubt it's widely used but it is potentially interesting.