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

Inline colour conversion syntax #94

Open
davesmith00000 opened this issue Oct 6, 2023 · 1 comment
Open

Inline colour conversion syntax #94

davesmith00000 opened this issue Oct 6, 2023 · 1 comment

Comments

@davesmith00000
Copy link
Member

davesmith00000 commented Oct 6, 2023

It would be really handy if you could write hex"FF0000" and you automagically got vec3(1.0f, 0.0f, 0.0f) for no work. Same for something that converted from integer RGB values (i.e. 0-255)

The use case is that copying colour values out of design tools is a faff at the moment.

@davesmith00000 davesmith00000 added enhancement New feature or request syntax sugar good first issue Good for newcomers labels Jan 2, 2024
@davesmith00000 davesmith00000 changed the title Feature? Inline colour conversion Inline colour conversion syntax Jan 2, 2024
@davesmith00000
Copy link
Member Author

I think custom string interpolators will do the trick.

https://docs.scala-lang.org/scala3/book/string-interpolation.html#custom-interpolators

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant