Package org.pentaho.reporting.libraries.css.values

Examples of org.pentaho.reporting.libraries.css.values.CSSColorValue


      return FunctionUtilities.parseNumberValue(value.toString(), type);
    }
    else if (value instanceof Color)
    {
      final Color color = (Color) value;
      return new CSSColorValue
              (color.getRed(), color.getGreen(),
                      color.getBlue(), color.getAlpha());
    }
    else
    {
View Full Code Here


          (FunctionUtilities.resolveParameter(layoutProcess, element, values[1]));
      final float lightValue = validateOtherParameter
          (FunctionUtilities.resolveParameter(layoutProcess, element, values[2]));
      final float[] rgb = ColorUtil.hslToRGB
              (hueValue, saturationValue, lightValue);
      return new CSSColorValue(rgb[0], rgb[1], rgb[2]);
    }
    else if (values.length == 4)
    {
      final int hueValue = validateHueParameter
          (FunctionUtilities.resolveParameter(layoutProcess, element, values[0]));
      final float saturationValue = validateOtherParameter
          (FunctionUtilities.resolveParameter(layoutProcess, element, values[1]));
      final float lightValue = validateOtherParameter
          (FunctionUtilities.resolveParameter(layoutProcess, element, values[2]));
      final float alphaValue = validateOtherParameter
          (FunctionUtilities.resolveParameter(layoutProcess, element, values[3]));
      final float[] rgb =
              ColorUtil.hslToRGB(hueValue, saturationValue, lightValue);
      return new CSSColorValue(rgb[0], rgb[1], rgb[2], alphaValue);
    }
    else
    {
      throw new FunctionEvaluationException("Expected either three or four parameters.");
    }
View Full Code Here

          (FunctionUtilities.resolveParameter(layoutProcess, element, values[0]));
      final int greenValue = validateParameter
          (FunctionUtilities.resolveParameter(layoutProcess, element, values[1]));
      final int blueValue = validateParameter
          (FunctionUtilities.resolveParameter(layoutProcess, element, values[2]));
      return new CSSColorValue(redValue, greenValue, blueValue);
    }
    else if (values.length == 4)
    {
      final int redValue = validateParameter
          (FunctionUtilities.resolveParameter(layoutProcess, element, values[0]));
      final int greenValue = validateParameter
          (FunctionUtilities.resolveParameter(layoutProcess, element, values[1]));
      final int blueValue = validateParameter
          (FunctionUtilities.resolveParameter(layoutProcess, element, values[2]));
      final int alphaValue = validateParameter
          (FunctionUtilities.resolveParameter(layoutProcess, element, values[3]));
      return new CSSColorValue(redValue, greenValue, blueValue, alphaValue);
    }
    else
    {
      throw new FunctionEvaluationException("Expected either three or four parameters.");
    }
View Full Code Here

        final int blueColorValue = charToNumber(colorSpec.charAt(3));
        final int colorValue =
            redColorValue << 20 | redColorValue << 16 |
            greenColorValue << 12 | greenColorValue << 8 |
            blueColorValue << 4 | blueColorValue;
        return new CSSColorValue(colorValue, false);
      }

      final Integer decoded = Integer.decode(colorSpec);
      return new CSSColorValue(decoded.intValue(), false);
    }
    catch (Exception e)
    {
      return null;
    }
View Full Code Here

TOP

Related Classes of org.pentaho.reporting.libraries.css.values.CSSColorValue

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.