on master help sign in
Fix undefined references for converting colors to css
commit149c39ffca1d46f80d9e3c62e0f3ef818b4563d9 authorEvan Czaplicki <info@elm-lang.org> dateSat 3 May 2014, 22:05 (13 years ago) parent444198d
1 file changed+4−4
runtime/Render/Collage.js+4−4
runtime/Render/Collage.js+4−4
@@ -5,7 +5,7 @@ var Render = ElmRuntime.use(ElmRuntime.Render.Element);
55var Transform = Elm.Transform2D.make({});
66var Utils = ElmRuntime.use(ElmRuntime.Render.Utils);
77var newElement = Utils.newElement,
8− extract = Utils.extract, fromList = Utils.fromList,
8+ colorToCss = Utils.colorToCss, fromList = Utils.fromList,
99 fromString = Utils.fromString, addTransform = Utils.addTransform;
1010
1111function trace(ctx, path) {
@@ -70,7 +70,7 @@ function drawLine(ctx, style, path) {
7070 ctx.lineJoin = join === 'Smooth' ? 'round' :
7171 join === 'Sharp' ? 'miter' : 'bevel';
7272 ctx.miterLimit = style.join._0 || 10;
73− ctx.strokeStyle = extract(style.color);
73+ ctx.strokeStyle = colorToCss(style.color);
7474 return line(ctx, style, path);
7575}
7676
@@ -96,7 +96,7 @@ function gradient(ctx, grad) {
9696 var len = stops.length;
9797 for (var i = 0; i < len; ++i) {
9898 var stop = stops[i];
99− g.addColorStop(stop._0, extract(stop._1));
99+ g.addColorStop(stop._0, colorToCss(stop._1));
100100 }
101101 return g;
102102}
@@ -105,7 +105,7 @@ function drawShape(redo, ctx, style, path) {
105105 trace(ctx, path);
106106 var sty = style.ctor;
107107 ctx.fillStyle =
108− sty === 'Solid' ? extract(style._0) :
108+ sty === 'Solid' ? colorToCss(style._0) :
109109 sty === 'Texture' ? texture(redo, ctx, style._0) : gradient(ctx, style._0);
110110 ctx.scale(1,-1);
111111 ctx.fill();