Add helper for displaying colors

master
Ben Moon 2016-07-05 10:35:34 +01:00
parent b132ab9026
commit d9073eb3a1
2 changed files with 5 additions and 6 deletions

View File

@ -1,6 +1 @@
<h3 class="c-base__title">
{{result_color}} <span
class="rgb_color--color-box" style="color:{{result_color}}">
&#9632
</span>
</h3>
<h3 class="c-base__title">{{{color result_color}}}</h3>

View File

@ -0,0 +1,4 @@
Handlebars.registerHelper('color', function(hex) {
return hex + ' <span class="rgb_color--color-box" style="color:' +
hex + '">&#9632</span>';
});