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

rewrite colour support #13

Closed
nebulon42 opened this issue Jan 15, 2016 · 6 comments
Closed

rewrite colour support #13

nebulon42 opened this issue Jan 15, 2016 · 6 comments

Comments

@nebulon42
Copy link
Contributor

I found a HuSL implementation in your code, but it is currently not accessible from CartoCSS. Additionally, HSL colour definitions are not supported yet.
Maybe it would be beneficial to rewrite colour support to some generic colour type, which is converted to RGB(A) at the end. Compare mapbox/carto#422, where I defined colours internally as HSLA including a flag if we are in perceptual space or not.

I tried to implement HSLA support, but got stuck at

func fmtColor(v color.RGBA, ok bool) *string {
. My Go knowledge is not good enough to figure out how to input some more generic type to this function and do the necessary adjustments within. Maybe you have a hint.

Another thing: it might be better to move the HuSL implementation to some external library.

@nebulon42 nebulon42 changed the title HUSL? rewrite colour support Jan 15, 2016
@nebulon42
Copy link
Contributor Author

Currently working on a HUSL port to Go.

@olt
Copy link
Member

olt commented Jan 16, 2016

Currently it's only used by SetHue which can be called from CartoCSS with -mc-set-hue.

@nebulon42
Copy link
Contributor Author

My Go implementation of HUSL can be found here: https://github.com/husl-colors/husl-go

@nebulon42
Copy link
Contributor Author

@olt What is the use case of this custom expression (-mc-set-hue)?

@olt
Copy link
Member

olt commented Jan 20, 2016

It sets the hue of A to the hue of B. So that you get a new color with the same saturation/lightness of A, but the hue of B.

@nebulon42
Copy link
Contributor Author

Solved by merging #15.

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

No branches or pull requests

2 participants