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

Support transparency (8 digit hex code:) for categorical variables? #79

Closed
rsignell-usgs opened this issue Jan 18, 2017 · 3 comments
Closed

Comments

@rsignell-usgs
Copy link

rsignell-usgs commented Jan 18, 2017

I was wondering to specify a transparent value for one of my category values to ncWMS, and found this discussion of an 8-digit specification:
http://stackoverflow.com/a/39718004

The first 6 digits are interpreted identically to the 6-digit notation. The last pair of digits, interpreted as a hexadecimal number, specifies the alpha channel of the color, where 00 represents a fully transparent color and ff represent a fully opaque color.

So a specification of #0000ffcc represents the same color as rgba(0, 0, 100%, 80%) (a slightly-transparent blue).

Could this be used in ncWMS?

Or is there another way to specify transparent color?

@rsignell-usgs rsignell-usgs changed the title Support 8 digit hex code for categorical variables? Support transparency (8 digit hex code:) for categorical variables? Jan 18, 2017
@guygriffiths
Copy link
Contributor

Hmm, we implemented something like this for ncWMS quite a while ago but used #AARRGGBB, rather than #RRGGBBAA. That's the current way of doing it.

But if the #RRGGBBAA is becoming more standard, perhaps we should switch to that? @jonblower - any thoughts?

@guygriffiths
Copy link
Contributor

guygriffiths commented Jan 19, 2017

Just had a browse of the code and changing formats now is a definite no. ncWMS writes out the full 8-digit notation into config files so changing it would break existing configs.

Also, a quick Google suggests that the term #AARRGGBB occurs about twice as often as #RRGGBBAA, so it doesn't seem like it's been standardised in any way, but we're using the most common representation.

@rsignell-usgs
Copy link
Author

rsignell-usgs commented Jan 19, 2017

@guygriffiths, this is great!

I certainly don't care about how transparency is specified, I just didn't even know that it was a possibility!

I was looking at the documentation on categorical data:
https://reading-escience-centre.gitbooks.io/ncwms-user-guide/content/05-data_formats.html#categorical
where all the examples use the 6 digit #RRGGBB colors, and didn't even look at the section on colour palettes, where you describe the 8 digit #AARRGGBB colors with transparency.

My endpoint is working as I want it to now:
2017-01-19_7-26-30

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