selectMode function
Selects the half of a light-dark() expression matching mode.
A value that is not a light-dark() expression is returned unchanged, so
this is safe to apply to anything.
Implementation
String selectMode(String value, AstryxThemeMode mode) {
final pair = parseLightDark(value);
if (pair == null) return value;
return mode == AstryxThemeMode.dark ? pair.dark : pair.light;
}