Microsoft/vscode
Auf GitHub ansehenUse modern (CSS color level 4) syntax for colors in the color picker
Open
#139.840 geöffnet am 28. Dez. 2021
editor-color-pickerfeature-requesthelp wanted
Repository-Metriken
- Stars
- (74.848 Stars)
- PR-Merge-Metriken
- (Durchschn. Merge 11h 43m) (1.000 gemergte PRs in 30 T)
Beschreibung
When converting colors using the color picker, the old comma-based syntax is used:
(it should also show hsl here, at the top of the picker, not rgba)
Please update the picker to use the modern (CSS color level 4) syntax for colors.
With regard to the exact syntax, I agree with these suggestions from @mathiasbynens:
- consider being opinionated w.r.t. how to represent alpha values. IMHO using percentage notation is most readable, as it clarifies the range: e.g. 70% vs 0.7
- consider being opinionated about using the deg suffix where applicable, e.g. in the first parameter for hsl() and the last non-alpha parameter for lch(). Again, because this clarifies that the range lies between 0-360.
i.e. Use percentages for alpha, and always include the deg suffix.
This also matches the syntax displayed in Chrome developer tools.