on master help sign in
Rename some of the Graphics libraries
commitd114746957ec3ea176a41d0e87068ed722d9ff2d authorevancz <info@elm-lang.org> dateSun 28 Apr 2013, 05:21 (14 years ago) parent06e6b31
8 files changed+18−29
libraries/Color.elm+1−9 libraries/Graphics/Collage.elm+2−2 libraries/Graphics/Element.elm+1−1 libraries/Matrix2D.elm+2−2 libraries/Native/Graphics/Color.js → libraries/Native/Color.js+3−4 libraries/Native/Graphics/Matrix.js → libraries/Native/Matrix2D.js+3−4 libraries/Native/Graphics/Text.js → libraries/Native/Text.js+4−5 libraries/Text.elm+2−2
libraries/Color.elm+1−9
@@ -1,13 +1,5 @@
11
2−module Graphics.Color (rgba,rgb,hsva,hsv,
3− complement,
4− red,lime,blue,
5− yellow,cyan,magenta,
6− maroon,navy,green,
7− teal,purple,
8− violet,forestGreen,
9− black,white,gray,grey,
10− linear,radial) where
2+module Color where
113
124data Color = Color Int Int Int Float
135
libraries/Graphics/Collage.elm+2−2
@@ -3,10 +3,10 @@ module Graphics.Collage where
33
44import Either
55import Graphics.Geometry
6−import Native.Graphics.Matrix as Matrix
6+import Native.Matrix2D as Matrix
77import Native.Graphics.Collage as N
88import Graphics.Element
9−import Graphics.Color as Color
9+import Color as Color
1010
1111type Form = {
1212 theta : Float,
libraries/Graphics/Element.elm+1−1
@@ -15,7 +15,7 @@ module Graphics.Element (widthOf, heightOf, sizeOf,
1515import Native.Utils (guid, max, htmlHeight)
1616import JavaScript as JS
1717import List as List
18−import Graphics.Color as Color
18+import Color
1919import Maybe (Just, Nothing)
2020
2121type Properties = {
libraries/Matrix2D.elm+2−2
@@ -1,7 +1,7 @@
11
2−module Graphics.Matrix where
2+module Matrix2D where
33
4−import Native.Graphics.Matrix as M
4+import Native.Matrix2D as M
55
66identity : Matrix
77
libraries/Native/Graphics/Color.js → libraries/Native/Color.jsrenamed+3−4
@@ -1,11 +1,10 @@
11
22
3−Elm.Native.Graphics.Color = function(elm) {
3+Elm.Native.Color = function(elm) {
44 "use strict";
55
66 elm.Native = elm.Native || {};
7− elm.Native.Graphics = elm.Native.Graphics || {};
8− if (elm.Native.Graphics.Color) return elm.Native.Graphics.Color;
7+ if (elm.Native.Color) return elm.Native.Color;
98
109 function complement(rgb) {
1110 var hsv = toHSV(rgb);
@@ -57,7 +56,7 @@ Elm.Native.Graphics.Color = function(elm) {
5756 return { ctor:"Color", _0:norm(r+m), _1:norm(g+m), _2:norm(b+m), _3:1 };
5857 }
5958
60− return elm.Native.Graphics.Color = {
59+ return elm.Native.Color = {
6160 hsva:F4(hsva),
6261 hsv:F3(hsv),
6362 complement:complement
libraries/Native/Graphics/Matrix.js → libraries/Native/Matrix2D.jsrenamed+3−4
@@ -1,10 +1,9 @@
11
2−Elm.Native.Graphics.Matrix = function(elm) {
2+Elm.Native.Matrix2D = function(elm) {
33 "use strict";
44
55 elm.Native = elm.Native || {};
6− elm.Native.Graphics = elm.Native.Graphics || {};
7− if (elm.Native.Graphics.Matrix) return elm.Native.Graphics.Matrix;
6+ if (elm.Native.Matrix2D) return elm.Native.Matrix2D;
87
98 try { Float32Array; } catch(e) { Float32Array = Array; }
109 var A = Float32Array;
@@ -54,7 +53,7 @@ Elm.Native.Graphics.Matrix = function(elm) {
5453 return transform(m[0], m[3], m[1], m[4], m[2], m[5], n);
5554 }
5655
57− return elm.Native.Graphics.Matrix = {
56+ return elm.Native.Matrix2D = {
5857 identity:identity,
5958 matrix:F6(matrix),
6059 multiply:F2(multiply),
libraries/Native/Graphics/Text.js → libraries/Native/Text.jsrenamed+4−5
@@ -1,14 +1,13 @@
11
2−Elm.Native.Graphics.Text = function(elm) {
2+Elm.Native.Text = function(elm) {
33 'use strict';
44
55 elm.Native = elm.Native || {};
6− elm.Native.Graphics = elm.Native.Graphics || {};
7− if (elm.Native.Graphics.Text) return elm.Native.Graphics.Text;
6+ if (elm.Native.Text) return elm.Native.Text;
87
98 var JS = Elm.JavaScript(elm);
109 var htmlHeight = Elm.Native.Utils(elm).htmlHeight;
11− var Color = Elm.Native.Graphics.Color(elm);
10+ var Color = Elm.Native.Color(elm);
1211 var Element = Elm.Graphics.Element(elm);
1312 var show = Elm.Native.Show(elm).show;
1413
@@ -110,7 +109,7 @@ Elm.Native.Graphics.Text = function(elm) {
110109 return position('left')(toText(v));
111110 }
112111
113− return elm.Native.Graphics.Text = {
112+ return elm.Native.Text = {
114113 toText: toText,
115114
116115 header : header,
libraries/Text.elm+2−2
@@ -1,7 +1,7 @@
11
2−module Graphics.Text where
2+module Text where
33
4−import Native.Graphics.Text as T
4+import Native.Text as T
55
66
77-- Convert a string into text which can be styled and displayed.