Skip to content
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

feature: Color type and syntaxes #82

Merged
merged 8 commits into from
Nov 3, 2020
Merged

feature: Color type and syntaxes #82

merged 8 commits into from
Nov 3, 2020

Conversation

Mwexim
Copy link
Owner

@Mwexim Mwexim commented Oct 18, 2020

This pull request yet again adds syntaxes described in issue #40:

  • A new Color class that stores colours based on their RGB value (but the stringify-method will present it as HEX). This means that the storing of colours is done through RGB but the actual parsing and displaying is just a HEX.
  • Color type with parsing and displaying. Currently, the literal parser uses the '&' symbol (instead of the regular '#') to parse colours since hashtags are occupied for comments already. I was thinking about something like 0xffffff or xffffff (or even x_ffffff) as alternatives. But currently, it'll be something like &ffffff.
  • Added ExprColorValues and ExprColorFromRGB (these classes speak for themselves).
  • Added support for several literal colours like yellow, lime, maroon, ...

Lastly, I fixed an issue where the Type type was omitted for some weird reason, resulting in the ExprParseAs to not be usable.

I know the current design is a bit sloppy right now, so please let me know any improvements design-wise and coding-wise.

Copy link
Contributor

@Olyno Olyno left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting features 😃 I think it can be improved 😉

Olyno
Olyno previously approved these changes Oct 25, 2020
@Mwexim Mwexim merged commit 86673dd into master Nov 3, 2020
@Mwexim Mwexim deleted the feature/color-syntaxes branch November 3, 2020 22:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants