Skip to content

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

@teqnology

Description

@teqnology

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}.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions