Commit a0567a26 authored by Jennie Yoder's avatar Jennie Yoder

trying to fix the "my model is all black" issue.

parent 7597cee3
......@@ -265,8 +265,13 @@ Blockly.Xml.domToWorkspace = function(workspace, xml) {
if (xmlChild.nodeName.toLowerCase() == 'color') {
var col = xmlChild.getAttribute('rgba');
var colA = col.split(',');
Blockscad.setColor(colA[0],colA[1],colA[2]);
found_color = true;
if (colA.length == 3)
if (colA[0] >= 0 && colA[0] < 255)
if (colA[1] >= 0 && colA[1] < 255)
if (colA[2] >= 0 && colA[2] < 255) {
Blockscad.setColor(colA[0],colA[1],colA[2]);
found_color = true;
}
}
if (xmlChild.nodeName.toLowerCase() == 'block') {
var block = Blockly.Xml.domToBlock(workspace, xmlChild);
......
......@@ -293,6 +293,7 @@ Blockscad.init = function() {
});
// add "default color" picker to viewer
// r,g,b is expecting to get color values between 0 and 255 for r,g,b
Blockscad.setColor = function(r,g,b) {
// console.log("in setColor. rgb:" + r + ";" + g + ';' + b);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment