changeset 1372:8dc3a4c1f7fb 2.2-b15

Automated merge with ssh://jfxsrc.us.oracle.com//javafx/2.2/MASTER/jfx//rt
author Yao Wang <yao.w.wang@oracle.com>
date Tue, 26 Jun 2012 10:11:28 -0700
parents 5b984ca53761 ab81c2cf3cca
children 5f3d913cf4e3 7f0d5537b52a
files
diffstat 6 files changed, 324 insertions(+), 44 deletions(-) [+]
line wrap: on
line diff
--- a/javafx-ui-common/src/javafx/scene/canvas/GraphicsContext.java	Mon Jun 25 13:05:37 2012 -0700
+++ b/javafx-ui-common/src/javafx/scene/canvas/GraphicsContext.java	Tue Jun 26 10:11:28 2012 -0700
@@ -140,7 +140,7 @@
             this(1.0, BlendMode.SRC_OVER,
                  new Affine2D(),
                  Color.BLACK, Color.BLACK,
-                 1.0, StrokeLineCap.BUTT, StrokeLineJoin.MITER, 10.0,
+                 1.0, StrokeLineCap.SQUARE, StrokeLineJoin.MITER, 10.0,
                  0, Font.getDefault(), TextAlignment.LEFT, VPos.BASELINE,
                  null, FillRule.NON_ZERO);
         }
--- a/javafx-ui-common/src/javafx/scene/image/PixelFormat.java	Mon Jun 25 13:05:37 2012 -0700
+++ b/javafx-ui-common/src/javafx/scene/image/PixelFormat.java	Tue Jun 26 10:11:28 2012 -0700
@@ -127,9 +127,9 @@
         int r = (nonpre >> 16) & 0xff;
         int g = (nonpre >>  8) & 0xff;
         int b = (nonpre      ) & 0xff;
-        r = (r * a) / 0xff;
-        g = (g * a) / 0xff;
-        b = (b * a) / 0xff;
+        r = (r * a + 127) / 0xff;
+        g = (g * a + 127) / 0xff;
+        b = (b * a + 127) / 0xff;
         return (a << 24) | (r << 16) | (g << 8) | b;
     }
 
--- a/javafx-ui-common/src/javafx/scene/image/WritablePixelFormat.java	Mon Jun 25 13:05:37 2012 -0700
+++ b/javafx-ui-common/src/javafx/scene/image/WritablePixelFormat.java	Tue Jun 26 10:11:28 2012 -0700
@@ -152,10 +152,10 @@
                             int argb)
         {
             int index = y * scanlineStride + x * 4;
-            buf.put(index,     (byte) (argb >> 24));
-            buf.put(index + 1, (byte) (argb >> 16));
-            buf.put(index + 2, (byte) (argb >>  8));
-            buf.put(index + 3, (byte) (argb      ));
+            buf.put(index,     (byte) (argb      ));
+            buf.put(index + 1, (byte) (argb >>  8));
+            buf.put(index + 2, (byte) (argb >> 16));
+            buf.put(index + 3, (byte) (argb >> 24));
         }
     }
 
@@ -199,17 +199,17 @@
                 g = (argb >>  8) & 0xff;
                 b = (argb      ) & 0xff;
                 if (a < 0xff) {
-                    r = (r * a) / 0xff;
-                    g = (g * a) / 0xff;
-                    b = (b * a) / 0xff;
+                    r = (r * a + 127) / 0xff;
+                    g = (g * a + 127) / 0xff;
+                    b = (b * a + 127) / 0xff;
                 }
             } else {
                 a = r = g = b = 0;
             }
-            buf.put(index,     (byte) a);
-            buf.put(index + 1, (byte) r);
-            buf.put(index + 2, (byte) g);
-            buf.put(index + 3, (byte) b);
+            buf.put(index,     (byte) b);
+            buf.put(index + 1, (byte) g);
+            buf.put(index + 2, (byte) r);
+            buf.put(index + 3, (byte) a);
         }
     }
 }
--- a/javafx-ui-common/src/javafx/scene/paint/Color.java	Mon Jun 25 13:05:37 2012 -0700
+++ b/javafx-ui-common/src/javafx/scene/paint/Color.java	Tue Jun 26 10:11:28 2012 -0700
@@ -289,21 +289,24 @@
      * single digit in the range {@code 0} to {@code F}.
      * <li>An {@code rgb(r,g,b)} or {@code rgba(r,g,b,a)} format string.
      * Each of the {@code r}, {@code g}, or {@code b} values can be an integer
-     * from 0 to 255 or a percent value integer from 0 to 100 followed by the
-     * percent ({@code %}) character.  The alpha component, if present, is a
+     * from 0 to 255 or a floating point percentage value from 0.0 to 100.0
+     * followed by the percent ({@code %}) character.
+     * The alpha component, if present, is a
      * floating point value from 0.0 to 1.0.  Spaces are allowed before or
      * after the numbers and between the percentage number and its percent
      * sign ({@code %}).
      * <li>An {@code hsl(h,s,l)} or {@code hsla(h,s,l,a)} format string.
-     * The {@code h} value is an integer from 0 to 360 representing the hue
-     * angle on a color wheel in degrees with {@code 0} or {@code 360}
-     * representing red, {@code 120} representing green, and {@code 240}
-     * representing blue.  The {@code s} value is the saturation of the
-     * desired color represented as a percentage from gray ({@code 0}) to
-     * the fully saturated color ({@code 100}) and the {@code l} value
+     * The {@code h} value is a floating point number from 0.0 to 360.0
+     * representing the hue angle on a color wheel in degrees with
+     * {@code 0.0} or {@code 360.0} representing red, {@code 120.0}
+     * representing green, and {@code 240.0} representing blue.  The
+     * {@code s} value is the saturation of the desired color represented
+     * as a floating point percentage from gray ({@code 0.0}) to
+     * the fully saturated color ({@code 100.0}) and the {@code l} value
      * is the desired lightness or brightness of the desired color represented
-     * as a percentage from black ({@code 0}) to the full brightness of the
-     * color ({@code 100}).  The alpha component, if present, is a floating
+     * as a floating point percentage from black ({@code 0.0}) to the full
+     * brightness of the color ({@code 100.0}).
+     * The alpha component, if present, is a floating
      * point value from 0.0 to 1.0.  Spaces are allowed before or
      * after the numbers and between the percentage number and its percent
      * sign ({@code %}).
@@ -511,16 +514,16 @@
         } else if (type == PARSE_PERCENT) {
             throw new IllegalArgumentException("Invalid color specification");
         }
-        if (type == PARSE_ALPHA) {
-            double d = Double.parseDouble(color);
-            return (d < 0.0) ? 0.0 : ((d > 1.0) ? 1.0 : d);
-        }
-        int c = Integer.parseInt(color);
+        double c = ((type == PARSE_COMPONENT)
+                    ? Integer.parseInt(color)
+                    : Double.parseDouble(color));
         switch (type) {
+            case PARSE_ALPHA:
+                return (c < 0.0) ? 0.0 : ((c > 1.0) ? 1.0 : c);
             case PARSE_PERCENT:
-                return (c <= 0) ? 0.0 : ((c >= 100) ? 1.0 : (c / 100.0));
+                return (c <= 0.0) ? 0.0 : ((c >= 100.0) ? 1.0 : (c / 100.0));
             case PARSE_COMPONENT:
-                return (c <= 0) ? 0.0 : ((c >= 255) ? 1.0 : (c / 255.0));
+                return (c <= 0.0) ? 0.0 : ((c >= 255.0) ? 1.0 : (c / 255.0));
             case PARSE_ANGLE:
                 return ((c < 0.0)
                         ? ((c % 360.0) + 360.0)
@@ -546,21 +549,24 @@
      * single digit in the range {@code 0} to {@code F}.
      * <li>An {@code rgb(r,g,b)} or {@code rgba(r,g,b,a)} format string.
      * Each of the {@code r}, {@code g}, or {@code b} values can be an integer
-     * from 0 to 255 or a percent value integer from 0 to 100 followed by the
-     * percent ({@code %}) character.  The alpha component, if present, is a
+     * from 0 to 255 or a floating point percentage value from 0.0 to 100.0
+     * followed by the percent ({@code %}) character.
+     * The alpha component, if present, is a
      * floating point value from 0.0 to 1.0.  Spaces are allowed before or
      * after the numbers and between the percentage number and its percent
      * sign ({@code %}).
      * <li>An {@code hsl(h,s,l)} or {@code hsla(h,s,l,a)} format string.
-     * The {@code h} value is an integer from 0 to 360 representing the hue
-     * angle on a color wheel in degrees with {@code 0} or {@code 360}
-     * representing red, {@code 120} representing green, and {@code 240}
-     * representing blue.  The {@code s} value is the saturation of the
-     * desired color represented as a percentage from gray ({@code 0}) to
-     * the fully saturated color ({@code 100}) and the {@code l} value
+     * The {@code h} value is a floating point number from 0.0 to 360.0
+     * representing the hue angle on a color wheel in degrees with
+     * {@code 0.0} or {@code 360.0} representing red, {@code 120.0}
+     * representing green, and {@code 240.0} representing blue.  The
+     * {@code s} value is the saturation of the desired color represented
+     * as a floating point percentage from gray ({@code 0.0}) to
+     * the fully saturated color ({@code 100.0}) and the {@code l} value
      * is the desired lightness or brightness of the desired color represented
-     * as a percentage from black ({@code 0}) to the full brightness of the
-     * color ({@code 100}).  The alpha component, if present, is a floating
+     * as a floating point percentage from black ({@code 0.0}) to the full
+     * brightness of the color ({@code 100.0}).
+     * The alpha component, if present, is a floating
      * point value from 0.0 to 1.0.  Spaces are allowed before or
      * after the numbers and between the percentage number and its percent
      * sign ({@code %}).
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javafx-ui-common/test/unit/javafx/scene/image/PixelFormatTest.java	Tue Jun 26 10:11:28 2012 -0700
@@ -0,0 +1,236 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javafx.scene.image;
+
+import static junit.framework.Assert.assertEquals;
+import static junit.framework.Assert.assertTrue;
+
+import java.nio.ByteBuffer;
+import java.nio.IntBuffer;
+import javafx.scene.paint.Color;
+import org.junit.Test;
+
+public final class PixelFormatTest {
+    static Color derive(Color c, double opacity) {
+        return new Color(c.getRed(), c.getGreen(), c.getBlue(), c.getOpacity() * opacity);
+    }
+
+    static Color testColors[] = {
+        Color.WHITE,
+        Color.BLACK,
+        Color.RED,
+        Color.GREEN,
+        Color.BLUE,
+        Color.TRANSPARENT,
+        derive(Color.WHITE, 0.5),
+        derive(Color.BLACK, 0.5),
+        derive(Color.RED, 0.5),
+        derive(Color.GREEN, 0.5),
+        derive(Color.BLUE, 0.5),
+    };
+
+    static void checkArgb(int argb1, int argb2, double delta) {
+        assertEquals("alpha", (argb1 >> 24) & 0xff, (argb2 >> 24) & 0xff);
+        assertEquals("red",   (argb1 >> 16) & 0xff, (argb2 >> 16) & 0xff, delta);
+        assertEquals("green", (argb1 >>  8) & 0xff, (argb2 >>  8) & 0xff, delta);
+        assertEquals("blue",  (argb1      ) & 0xff, (argb2      ) & 0xff, delta);
+    }
+
+    void test(PixelFormat<ByteBuffer> pfb, ByteBuffer bbuf, Color c,
+              int aoff, int roff, int goff, int boff)
+    {
+        int alpha = (int) (c.getOpacity() * 255f);
+        int red   = (int) (c.getRed() * 255f);
+        int green = (int) (c.getGreen() * 255f);
+        int blue  = (int) (c.getBlue() * 255f);
+        int argb = (alpha << 24) | (red << 16) | (green << 8) | blue;
+        if (aoff < 0) {
+            if (alpha < 255) return;
+            bbuf.put(roff, (byte) red);
+            bbuf.put(goff, (byte) green);
+            bbuf.put(boff, (byte) blue);
+        } else {
+            assertTrue(pfb.isWritable());
+            ((WritablePixelFormat<ByteBuffer>) pfb).setArgb(bbuf, 0, 0, 0, argb);
+            assertEquals(alpha, bbuf.get(aoff) & 0xff);
+            if (pfb.isPremultiplied() && alpha < 255) {
+                red   = (red   * alpha + 127) / 255;
+                green = (green * alpha + 127) / 255;
+                blue  = (blue  * alpha + 127) / 255;
+            }
+        }
+        if (pfb.isPremultiplied()) {
+            assertEquals(red,   bbuf.get(roff) & 0xff, 1.0);
+            assertEquals(green, bbuf.get(goff) & 0xff, 1.0);
+            assertEquals(blue,  bbuf.get(boff) & 0xff, 1.0);
+        } else {
+            assertEquals(red,   bbuf.get(roff) & 0xff);
+            assertEquals(green, bbuf.get(goff) & 0xff);
+            assertEquals(blue,  bbuf.get(boff) & 0xff);
+        }
+        int argbtest = pfb.getArgb(bbuf, 0, 0, 0);
+        if (pfb.isPremultiplied() && alpha < 255) {
+            if (alpha > 0) {
+                int halfa = (alpha >> 1);
+                red   = (red   * 255 + halfa) / alpha;
+                green = (green * 255 + halfa) / alpha;
+                blue  = (blue  * 255 + halfa) / alpha;
+                argb = (alpha << 24) | (red << 16) | (green << 8) | blue;
+            } else {
+                argb = 0;
+            }
+        }
+        checkArgb(argb, argbtest, pfb.isPremultiplied() ? 1.0 : 0.0);
+    }
+
+    void test(WritablePixelFormat<IntBuffer> wpfi, IntBuffer ibuf, Color c,
+              int ashift, int rshift, int gshift, int bshift)
+    {
+        int alpha = (int) (c.getOpacity() * 255f);
+        int red   = (int) (c.getRed() * 255f);
+        int green = (int) (c.getGreen() * 255f);
+        int blue  = (int) (c.getBlue() * 255f);
+        int argb = (alpha << 24) | (red << 16) | (green << 8) | blue;
+        wpfi.setArgb(ibuf, 0, 0, 0, argb);
+        if (wpfi.isPremultiplied() && alpha < 255) {
+            red   = (red   * alpha + 127) / 255;
+            green = (green * alpha + 127) / 255;
+            blue  = (blue  * alpha + 127) / 255;
+        }
+        assertEquals(alpha, (ibuf.get(0) >> ashift) & 0xff);
+        assertEquals(red,   (ibuf.get(0) >> rshift) & 0xff);
+        assertEquals(green, (ibuf.get(0) >> gshift) & 0xff);
+        assertEquals(blue,  (ibuf.get(0) >> bshift) & 0xff);
+        int argbtest = wpfi.getArgb(ibuf, 0, 0, 0);
+        if (wpfi.isPremultiplied() && alpha < 255) {
+            if (alpha > 0) {
+                int halfa = (alpha >> 1);
+                red   = (red   * 255 + halfa) / alpha;
+                green = (green * 255 + halfa) / alpha;
+                blue  = (blue  * 255 + halfa) / alpha;
+                argb = (alpha << 24) | (red << 16) | (green << 8) | blue;
+            } else {
+                argb = 0;
+            }
+        }
+        checkArgb(argb, argbtest, wpfi.isPremultiplied() ? 1.0 : 0.0);
+    }
+
+    void testColors(PixelFormat<ByteBuffer> wpfb, ByteBuffer bbuf,
+                    int aoff, int roff, int goff, int boff)
+    {
+        for (Color c : testColors) {
+            test(wpfb, bbuf, c, aoff, roff, goff, boff);
+        }
+    }
+
+    void testColors(WritablePixelFormat<IntBuffer> wpfi, IntBuffer ibuf,
+                    int ashift, int rshift, int gshift, int bshift)
+    {
+        for (Color c : testColors) {
+            test(wpfi, ibuf, c, ashift, rshift, gshift, bshift);
+        }
+    }
+
+    @Test
+    public void testByteBgraGetSetArgb() {
+        WritablePixelFormat<ByteBuffer> byteBgra = PixelFormat.getByteBgraInstance();
+        ByteBuffer bbuf = ByteBuffer.allocate(4);
+        testColors(byteBgra, bbuf, 3, 2, 1, 0);
+    }
+
+    @Test
+    public void testByteBgraPreGetSetArgb() {
+        WritablePixelFormat<ByteBuffer> byteBgraPre = PixelFormat.getByteBgraPreInstance();
+        ByteBuffer bbuf = ByteBuffer.allocate(4);
+        testColors(byteBgraPre, bbuf, 3, 2, 1, 0);
+    }
+
+    @Test
+    public void testByteRgbGetArgb() {
+        PixelFormat<ByteBuffer> byteRgb = PixelFormat.getByteRgbInstance();
+        ByteBuffer bbuf = ByteBuffer.allocate(4);
+        testColors(byteRgb, bbuf, -1, 0, 1, 2);
+    }
+
+    @Test
+    public void testIntArgbGetSetArgb() {
+        WritablePixelFormat<IntBuffer> intArgb = PixelFormat.getIntArgbInstance();
+        IntBuffer ibuf = IntBuffer.allocate(1);
+        testColors(intArgb, ibuf, 24, 16, 8, 0);
+    }
+
+    @Test
+    public void testIntArgbPreGetSetArgbPre() {
+        WritablePixelFormat<IntBuffer> intArgbPre = PixelFormat.getIntArgbPreInstance();
+        IntBuffer ibuf = IntBuffer.allocate(1);
+        testColors(intArgbPre, ibuf, 24, 16, 8, 0);
+    }
+
+    int[] getPalette(boolean premultiplied) {
+        int numcolors = Math.min(testColors.length, 256);
+        int colors[] = new int[numcolors];
+        for (int i = 0; i < numcolors; i++) {
+            Color c = testColors[i];
+            int alpha = (int) (c.getOpacity() * 255f);
+            int red   = (int) (c.getRed() * 255f);
+            int green = (int) (c.getGreen() * 255f);
+            int blue  = (int) (c.getBlue() * 255f);
+            if (premultiplied && alpha < 255) {
+                red   = (red   * alpha + 127) / 255;
+                green = (green * alpha + 127) / 255;
+                blue  = (blue  * alpha + 127) / 255;
+            }
+            colors[i] = (alpha << 24) | (red << 16) | (green << 8) | blue;
+        }
+        return colors;
+    }
+
+    @Test
+    public void testByteIndexedGetArgb() {
+        int palette[] = getPalette(false);
+        PixelFormat<ByteBuffer> byteIndexed = PixelFormat.createByteIndexedInstance(palette);
+        ByteBuffer bbuf = ByteBuffer.allocate(1);
+        for (int i = 0; i < 256; i++) {
+            bbuf.put(0, (byte) i);
+            int argb = byteIndexed.getArgb(bbuf, 0, 0, 0);
+            checkArgb((i < palette.length) ? palette[i] : 0, argb, 0.0);
+        }
+    }
+
+    @Test
+    public void testByteIndexedPreGetArgb() {
+        int palette[] = getPalette(false);
+        int palettepre[] = getPalette(true);
+        PixelFormat<ByteBuffer> byteIndexed = PixelFormat.createByteIndexedPremultipliedInstance(palettepre);
+        ByteBuffer bbuf = ByteBuffer.allocate(1);
+        for (int i = 0; i < 256; i++) {
+            bbuf.put(0, (byte) i);
+            int argb = byteIndexed.getArgb(bbuf, 0, 0, 0);
+            checkArgb((i < palette.length) ? palette[i] : 0, argb, 1.0);
+        }
+    }
+}
--- a/javafx-ui-common/test/unit/javafx/scene/paint/ColorTest.java	Mon Jun 25 13:05:37 2012 -0700
+++ b/javafx-ui-common/test/unit/javafx/scene/paint/ColorTest.java	Tue Jun 26 10:11:28 2012 -0700
@@ -526,6 +526,15 @@
     }
 
     @Test
+    public void testWebRgbPercentFloat() {
+        Color color = Color.web("rgb(60.0%, 40.0%, 100.0%)");
+        assertEquals(0.6, color.getRed(), 0.0001);
+        assertEquals(0.4, color.getGreen(), 0.0001);
+        assertEquals(1.0, color.getBlue(), 0.0001);
+        assertEquals(1.0, color.getOpacity(), 0.0001);
+    }
+
+    @Test
     public void testWebRgbPercentRange() {
         Color c1 = Color.web("rgb(100%,  0%, 100%)");
         Color c2 = Color.web("rgb(101%, -1%, 101%)");
@@ -543,6 +552,15 @@
         assertEquals(1.0, color.getBlue(), 0.0001);
         assertEquals(0.6, color.getOpacity(), 0.0001);
     }
+    
+    @Test
+    public void testWebRgbaPercentFloat() {
+        Color color = Color.web("rgba(60.0%, 40.0%, 100.0%, 0.6)");
+        assertEquals(0.6, color.getRed(), 0.0001);
+        assertEquals(0.4, color.getGreen(), 0.0001);
+        assertEquals(1.0, color.getBlue(), 0.0001);
+        assertEquals(0.6, color.getOpacity(), 0.0001);
+    }
 
     @Test
     public void testWebRgbaPercentRange() {
@@ -559,7 +577,7 @@
 
     @Test
     public void testWebRgbPercentMix() {
-        Color color = Color.web("rgb(60%, 40%, 192)");
+        Color color = Color.web("rgb(60%, 40.0%, 192)");
         assertEquals(0.6, color.getRed(), 0.0001);
         assertEquals(0.4, color.getGreen(), 0.0001);
         assertEquals(192.0/255.0, color.getBlue(), 0.0001);
@@ -568,7 +586,7 @@
 
     @Test
     public void testWebRgbaPercentMix() {
-        Color color = Color.web("rgba(60%, 40%, 192, 0.6)");
+        Color color = Color.web("rgba(60%, 40.0%, 192, 0.6)");
         assertEquals(0.6, color.getRed(), 0.0001);
         assertEquals(0.4, color.getGreen(), 0.0001);
         assertEquals(192.0/255.0, color.getBlue(), 0.0001);
@@ -586,6 +604,16 @@
     }
 
     @Test
+    public void testWebHslFloat() {
+        Color color = Color.web("hsl(180.0, 50.0%, 100.0%)");
+        Color ref = Color.hsb(180, 0.5, 1.0);
+        assertEquals(ref.getRed(),     color.getRed(),     0.0001);
+        assertEquals(ref.getGreen(),   color.getGreen(),   0.0001);
+        assertEquals(ref.getBlue(),    color.getBlue(),    0.0001);
+        assertEquals(ref.getOpacity(), color.getOpacity(), 0.0001);
+    }
+
+    @Test
     public void testWebHslRange() {
         Color c1 = Color.web("hsl( 240,  0%, 100%)");
         Color c2 = Color.web("hsl(-120, -1%, 101%)");
@@ -606,6 +634,16 @@
     }
 
     @Test
+    public void testWebHslaFloat() {
+        Color color = Color.web("hsla(180.0, 50.0%, 100.0%, 0.6)");
+        Color ref = Color.hsb(180, 0.5, 1.0, 0.6);
+        assertEquals(ref.getRed(),     color.getRed(),     0.0001);
+        assertEquals(ref.getGreen(),   color.getGreen(),   0.0001);
+        assertEquals(ref.getBlue(),    color.getBlue(),    0.0001);
+        assertEquals(ref.getOpacity(), color.getOpacity(), 0.0001);
+    }
+
+    @Test
     public void testWebHslaRange() {
         Color c1 = Color.web("hsla( 240,  0%, 100%, 1.0)");
         Color c2 = Color.web("hsla(-120, -1%, 101%, 1.1)");