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

make_color() returns "#00000.randomhex" when base_color: black #50

Open
teqnology opened this issue May 29, 2015 · 1 comment
Open

make_color() returns "#00000.randomhex" when base_color: black #50

teqnology opened this issue May 29, 2015 · 1 comment

Comments

@teqnology
Copy link

So, my code is:

var csscolornames = ["AliceBlue", "AntiqueWhite", "Aqua", "Aquamarine", "Azure", "Beige", "Bisque", "Black",  "BlanchedAlmond", etc];
chex = Please.make_color({base_color: csscolornames[i]});
console.log("CHEX " + chex);
chsv = Please.HEX_to_HSV(String(chex));

Everything works except when chex is using base_color:black. The console.log chex shows: #000000.randomhex where "randomhex" is a relative black color (eg. #240000). The subsequent comand HEX_to_HSV fails as the String is not in actual HEX format. Also, I need to use HEX_to_HSV as apparently if I use format:'hsv' in make_color(), the object returned doesn't have any values stored (eg. h, s, v), so I can't access them (eg. chex.h, chex.s, chex.v), if I try to console.log chex it would be [Object] [object], but when I use HEX_to_HSV, the console.log chsv would show me eg. [Object] {h:98, s:.4, v:.5}.

@teqnology
Copy link
Author

A quick add, here is the complete list of colors that are bugged:
Black, DarkGrey, DarkGray, DimGrey, DimGray, Gainsboro, Gray, Grey, LightGray, LightGrey, Silver, White, WhiteSmoke.
I tried to run:

for(var z=0;z<csscolornames.length;z++){
        console.log(csscolornames[z]);
        console.log(Please.make_color({base_color: csscolornames[z]}));
    }

The result is similar to this:

Wheat
["#957a43"]
White
["#000000.73f6d13"]


LightGoldenRodYellow
["#a6aa2f"]
LightGray
["#000000.9556cdf"]
LightGrey
["#000000.d389aac"]
LightGreen
["#5c9e5a"]

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

1 participant