-
Notifications
You must be signed in to change notification settings - Fork 43
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
Named palettes yield unexpected result #855
Comments
Does
yield the same? |
🤦🏻♂️ Would it make sense to override this in large image having the following in if value == 'green':
# see https://github.com/girder/large_image/issues/855#issuecomment-
value = '#0f0' |
I don't think there is a good answer here -- if we muck with what |
Since this is an image-focused library, I think "green" has a specific meaning in this context to refer to the Green channel of an RGB image which should be mapped to IMO, it is more surprising to follow a CSS convention than the convention of the RGB color model here
That's a fair compromise, but I think the following would be clunky:
Though the following looks nice to me and we could document that
|
No matter what, this should be documented in |
Except that a lot of the names are from css (e.g.,
Yes -- that's why using all caps would be mapped for red and blue, too. |
IMO the palette spec could be designed better. The priority order and all the things a string value could represent seems potentially confusing to users.
As one idea, I'd suggest new specification modes for the different conditionals so the function does not need to interpret opaque strings in so many ways, something like this: {
bands: [
{band: 1, palette: {channel: 'green'}}, // #000 to #0f0
{band: 2, palette: {matplotlib: 'jet'}},
{band: 3, palette: {palettable: 'Earth_7'}},
{band: 4, palette: ['red', '#112233', 'purple', 'green']}, // interpreted as CSS colors
]
} Single-string palettes like This would still let someone do ['#000', 'green'] and get something perhaps unexpected, but I can't see a way around that because you probably want to support CSS colors in palette arrays. |
This was resolved in #858. |
I would assume the following two styles to be equivalent
However, they are not and produce totally different thumbnails:
Is this expected? Should
"red"
be interpreted as equivalent to['#000', '#f00']
The text was updated successfully, but these errors were encountered: