-
Notifications
You must be signed in to change notification settings - Fork 42
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
Colors with border? #17
Comments
I have the same problem as you. |
An outline will appear if you use Spectrum won't store any state for you; you'll have to use |
That was a fast reply! Thanks! About the other question, I knwo how to save the color select by the user so i Can save it myself. But is there a Way to pre-select the last color the user selected? |
Thank you @nwalters512, I have solved the problem by deleting |
@FedericoPonzi the outlining feature is sort of half-baked at this point. The other colors actually do have an outline; however, it's white, so it blends in with the background and makes it appear like there isn't one. See https://github.com/the-blue-alliance/spectrum/blob/master/spectrum/src/main/java/com/thebluealliance/spectrum/internal/ColorItem.java#L166 If you'd like to try to improve that behavior, you're welcome to submit a PR! |
This makes the border visible on all items, even if it was previously "hidden" for many items if the background was white. I had discussed some potential improvements to outlining here. I only really want to display the outline when it's absolutely necessary to differentiate the color from the background; I think it looks much cleaner this way. I also want to design the next iteration of this feature so that it's compatible with a dark background, in case I ever introduce theming for the various Spectrum dialogs.
I'm not quite sure what you mean by that - could you make an illustration to demonstrate what you mean? |
I don't think the solution should be to apply a very obvious outline to every single color just because a (generally small) subset of colors will require them. I think in most cases, it definitely looks the most clean to just leave colors borderless (even though most colors technically have a white border now, they're invisible against a white background and don't exist for all intents and purposes). That being said, there could be a real need for customization here. We should be shooting for sensible defaults while still letting developers customize as much as possible. One possible solution would be adding the ability to supply a public interface OutlinePaintProvider {
void setupPaint(Paint paint, @ColorInt int color);
} In this case, you would pass an implementation of |
Hi,
First of all thanks for the great library.
I've just added spectrum for an app I'm doing on my spare time (you can find the source on my github), and works fine but some colors appear with borders:
Also, is there a way to keep a state about the last selected color inside my dialog?
Thanks a lot!
The text was updated successfully, but these errors were encountered: