Closed z3dev closed 7 years ago
@biscuitlad you found a bug. I'm not sure what the issue is at this time, but was able to reproduce the issue.
It seems that other color names do not work, like "blue", "palegreen", etc. And as you mentioned, "red" works.
so does this mean the color lookup is failing ?
I'm writing the test now. I'll let you know.
By the way, this requires a table of CSS color names and RGB values. Not sure if this table needs to be exposed, but I'm going to export css2rgb() and rgb2css() functions.
does this mean that this code is not for css color names ? https://github.com/jscad/scad-api/blob/master/src/color.js#L4
The color list is CSS. But there's no way to convert directly from CSS name to RGB. The current function applies the color to an object. I want to separate our the css2rgb(), and change color() to call css2rgb() to get the color from the list, and then apply the color to the object. Slightly different.
ah yes, very nice, good idea, thanks for the clarification
I believe this is now fixed with the merge of #5 A final review would be appreciated.
Looks good to me ! Closing
From @biscuitlad on February 24, 2016 15:4
box = color("palegreen", 0.8, box); //fails lid = color("red", 0.8, lid); //works
Red will be transparent, any other colour seems to fail. You can swap these and still one will fail and the other work.
Copied from original issue: Spiritdude/OpenJSCAD.org#132