Very nice, however i have an issue with trying to implement this.
When declaring av variable type inerhitance makes it so that i cannot change to another color.
Example
Does not work
let color = Colors.GRAY_LIGHT; // Inherits the actual color value as type.
color = Colors.RED; // Red does not have the same value so does not work.
Works but a little annoying to do.
let color: ColorType = Colors.GRAY_LIGHT;
color = Colors.RED;
Anyone have a suggestion on how to "fix" this?
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Very nice, however i have an issue with trying to implement this.
When declaring av variable type inerhitance makes it so that i cannot change to another color.
Example
Does not work
let color = Colors.GRAY_LIGHT; // Inherits the actual color value as type.
color = Colors.RED; // Red does not have the same value so does not work.
Works but a little annoying to do.
let color: ColorType = Colors.GRAY_LIGHT;
color = Colors.RED;
Anyone have a suggestion on how to "fix" this?