Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
David-Mulder committed Dec 18, 2015
1 parent c342771 commit 596b554
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions paper-color-input.html
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
<span>{{colorName}}</span>&nbsp;<!--
--><template is="dom-if" if="{{withDescription}}"><!--
--><span class="light">rgb<template is="dom-if" if="{{allowAlpha}}">a</template>(</span><span class="dark">{{value.red}}</span><span class="light">, </span><span class="dark">{{value.green}}</span><span class="light">, </span><span class="dark">{{value.blue}}</span><template is="dom-if" if="{{allowAlpha}}"><span class="light">, </span><span class="dark">{{value.alpha}}</span></template><span class="light">)</span>
</template>
</template>
</div>
<div id="colorPreview" suffix>
<div id="color" style$="{{_computeBackgroundColor(value.*)}}"></div>
Expand Down Expand Up @@ -220,10 +220,12 @@
});

var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
console.log(this.valueAsHex, hex, result);
this.set('value.r', parseInt(result[1], 16));
this.set('value.g', parseInt(result[2], 16));
this.set('value.b', parseInt(result[3], 16));
if(typeof this.value === 'undefined'){
this.set('value', {});
}
this.set('value.red', parseInt(result[1], 16));
this.set('value.green', parseInt(result[2], 16));
this.set('value.blue', parseInt(result[3], 16));
}
});
</script>
Expand Down

0 comments on commit 596b554

Please sign in to comment.