-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Closed
Labels
DuplicateAn existing issue was already createdAn existing issue was already created
Description
Typing color names is risky since there is no checking for typos. It would be nice to have named colors as in Color.Wheat or something like that. Even nice would be to type a field like backgroundColor typechecked as an HTML color though I'm not sure how to do that while keeping fully compatible with JS.
For an application that had only a limited number of valid colors I created a static class
class Kolor {
static black: string = "black";
static silver: string = "silver";
static gray: string = "gray";
..
}
it didn't solve the type checking but did reduce typos.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
DuplicateAn existing issue was already createdAn existing issue was already created