Skip to content
Snippets Groups Projects
Commit a5e2bc81 authored by Neil Gershenfeld's avatar Neil Gershenfeld
Browse files

working on mask

parent 4fed869a
Branches
No related tags found
No related merge requests found
......@@ -49,7 +49,7 @@ var inputs = {
},
color:{type:'RGB',
event:function(evt){
mod.color.value = evt.detail
mod.color.value = JSON.stringify(evt.detail)
}
}
}
......
......@@ -30,14 +30,17 @@ var init = function() {
// inputs
//
var inputs = {
palette:{type:'text',
imageInfo:{type:'object',
event:function(evt){
mod.imageInfo = evt.detail
}},
imageInfo:{type:'object',
palette:{type:'text',
event:function(evt){
mod.palette = JSON.parse(evt.detail)
}},
path:{type:'(array)',
path:{type:'array',
event:function(evt){
mod.path = evt.detail
}}}
//
// outputs
......@@ -45,6 +48,7 @@ var inputs = {
var outputs = {
color:{type:'RGB',
event:function(evt){
mods.output(mod,'color',evt)
}},
SVG:{type:'file',
event:function(evt){
......@@ -64,6 +68,7 @@ var interface = function(div){
mod.labelspan = span
btn.appendChild(span)
btn.addEventListener('click',function(){
calculate_masks()
})
div.appendChild(btn)
div.appendChild(document.createElement('br'))
......@@ -71,6 +76,14 @@ var interface = function(div){
//
// local functions
//
// calculate_masks
//
function calculate_masks() {
for (var i = 0; i < mod.palette.length; ++i) {
outputs.color.event(mod.palette[i])
}
}
//
// save_svg_masks
//
function save_svg_masks() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment