I'm making an admin input panel.
Admin will have an option to create a custom color using an hexadecimal value such as #0000ff or #008000, etc.
Right now, I´m using this in my model:
[Required(AllowEmptyStrings = false, ErrorMessage = "Please enter the color")]
public string Color { get; set; }
How can I validate so the admin can only put hexadecimal values here?
And most importantly, is this really necessary? I heard that the browser tends to ignore false hex codes Why does HTML think “chucknorris” is a color?