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

Function setLastColor doesn't work for integer with less than 8 digits in hex #2

Open
gplab42 opened this issue Mar 4, 2016 · 3 comments

Comments

@gplab42
Copy link

gplab42 commented Mar 4, 2016

you could correct that using :
"#"+String.format("%08X", color)
instead of :
"#"+Integer.toHexString(color)

@StolarczykJakub
Copy link

I change it but i still get the error. But now it came from dissmis
(it's from Color.Picker.Dialog.class)
http://i.imgur.com/7832OhU.png

@mrkane27
Copy link

+1 to this

If you select the bottom-most part of the color viewer and go to full transparency, the color is #0 and it crashes.

@Ad9an
Copy link

Ad9an commented Jul 4, 2021

Fixing Alpha color like return less hex decimal number.
//hexVal is hex color that returns by library

    int length=hexVal.length();
    String withoutHash=hexVal.substring(1,length);


    while (withoutHash.length()<=7)
    {

        withoutHash="0"+withoutHash;

    }
    hexVal ="#"+withoutHash;

//use hexVal to set the color.

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

4 participants