@@ -4,6 +4,7 @@ Elm.Native.Text.make = function(elm) {
44 elm.Native.Text = elm.Native.Text || {};
55 if (elm.Native.Text.values) return elm.Native.Text.values;
66
7+ var Color = Elm.Native.Color.make(elm);
78 var Element = Elm.Graphics.Element.make(elm);
89 var List = Elm.Native.List.make(elm);
910 var Utils = Elm.Native.Utils.make(elm);
@@ -69,16 +70,10 @@ Elm.Native.Text.make = function(elm) {
6970 ctor === 'Over' ? 'overline' : 'line-through';
7071 return 'text-decoration:' + decoration + ';';
7172 }
72− function toColor(c) {
73− var color = (c._3 === 1)
74− ? ('rgb(' + c._0 + ', ' + c._1 + ', ' + c._2 + ')')
75− : ('rgba(' + c._0 + ', ' + c._1 + ', ' + c._2 + ', ' + c._3 + ')');
76− return 'color:' + color + ';';
77− }
7873
7974 // setting styles of Text
8075 function style(style, text) {
81− var newText = '<span style="' + toColor(style.color);
76+ var newText = '<span style="color:' + toCss(style.color) + ';'
8277 if (style.typeface.ctor !== '[]') {
8378 newText += 'font-family:' + toTypefaces(style.typeface) + ';'
8479 }
@@ -119,11 +114,8 @@ Elm.Native.Text.make = function(elm) {
119114 return { style: toLine(line), text:text };
120115 }
121116
122− function color(c, text) {
123− var color = (c._3 === 1)
124− ? ('rgb(' + c._0 + ', ' + c._1 + ', ' + c._2 + ')')
125− : ('rgba(' + c._0 + ', ' + c._1 + ', ' + c._2 + ', ' + c._3 + ')');
126− return { style: 'color:' + color + ';', text:text };
117+ function color(color, text) {
118+ return { style: 'color:' + toCss(color) + ';', text:text };
127119 }
128120
129121 function block(align) {