Skip to content

Colors in markup #13

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
csharpfritz opened this issue Jan 4, 2020 · 2 comments
Closed

Colors in markup #13

csharpfritz opened this issue Jan 4, 2020 · 2 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@csharpfritz
Copy link
Contributor

In Web Forms, you were able to set attribute values for colors to either a color name or to an HTML hex color representation. In our components, you're forced in a Color object

@csharpfritz csharpfritz added bug Something isn't working help wanted Extra attention is needed labels Jan 4, 2020
@Code-DJ
Copy link
Contributor

Code-DJ commented Jan 9, 2020

Is this supported? WebForms uses TypeConverter to handle this, but it appears this isn't fully implemented in Razor. Am I missing something?

dotnet/aspnetcore#8493

@csharpfritz
Copy link
Contributor Author

csharpfritz commented Jan 9, 2020

One idea I had considered was wrapping the System.Drawing.Color type as WebColor and provide and implicit conversion from string to WebColor that inspects and does the appropriate conversion.

WebColor should simply delegate to the System.Drawing.Color object while providing a good ToHtmlString() method that allows us to format the WebColor for our markup styles.

We could use the same static type architecture trick that we are using in BlazorWebFormsComponents.Enums.RepeatLayout to deliver this feature

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants