One natural use case use case of the information discovery facilities in css-font-loading would be "I want to swap the green color in my palette to my custom color." Doing this requires 2 steps:
- Iterating over the colors in the palette until you find green
- Creating a
@font-palette-values rule that maps the index of green to your new custom color
The trick here is the "index" of green. When you iterate through an iterable, it doesn't tell you what index you're at. So, if you want to determine what index green lies at, you have to track that yourself.
You can do this with a 3-clause for loop, and getter, but maybe we can do better here.