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

set initial colour? #8

Closed
ConfusedVorlon opened this issue Dec 7, 2015 · 3 comments
Closed

set initial colour? #8

ConfusedVorlon opened this issue Dec 7, 2015 · 3 comments

Comments

@ConfusedVorlon
Copy link

Hi,
firstly - thanks for a great picker.
is there a way to set the initial colour though?

I'm using the picker in a fragment to manage lots of different preferences.
It would be nice to set it to the previously chosen colour when a user pops it up.

(e.g. if the user previously chose green, the slider/picker would start at green)

setHistory doesn't seem to do that unless i'm missing something.

@LarsWerkman
Copy link
Owner

You could set the previous color position using setColorPosition
To retrieve your position you can use getColorPosition

@ConfusedVorlon
Copy link
Author

thanks for the reponse.
I don't that quite does what I want though; colorPosition doesn't correspond to an actual color, so I'd have to store separately the position of the slider.

I effectively use the whole picker as

@ColorInt int getColor() where color is a meaningful thing that I can use in an interface.

so it would be nice to have the reverse

setColor(@ColorInt int previousColor)

alternatively - is there a way to convert a color to a colorPosition that I'm missing?

thanks.

@LarsWerkman
Copy link
Owner

Currently there is no way yet, maybe in the future.

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