Examples of Colour


Examples of jxl.format.Colour

          break;
        }
      }

      Pattern mode = this.backgroundMode;
      Colour background = WHITE;

      if (!isIgnoreCellBackground && gridCell.getCellBackcolor() != null)
      {
        mode = Pattern.SOLID;
        background = getWorkbookColour(gridCell.getCellBackcolor(), true);
      }

      if (element.getModeValue() == ModeEnum.OPAQUE)
      {
        background = getWorkbookColour(element.getBackcolor(), true);
      }

      Colour forecolor = getWorkbookColour(element.getLineBox().getPen().getLineColor());

      WritableFont cellFont2 = this.getLoadedFont(getDefaultFont(), forecolor.getValue(), getLocale());

      WritableCellFormat cellStyle2 =
        getLoadedCellStyle(
          mode,
          background,
View Full Code Here

Examples of jxl.format.Colour

    return getWorkbookColour(awtColor);
  }

  protected Colour getWorkbookColour(Color awtColor)
  {
    Colour colour;
    if (createCustomPalette)
    {
      colour = (Colour) workbookColours.get(awtColor);
      if (colour == null)
      {
View Full Code Here

Examples of jxl.format.Colour

  protected Colour determineWorkbookColour(Color awtColor)
  {
    //nearest match
    int minDist = 999;
    Colour minColour = null;

    //nearest match among the available (not used) colours
    int minDistAvailable = 999;
    Colour minColourAvailable = null;

    Colour[] colors = Colour.getAllColours();
    for (int i = 0; i < colors.length; i++)
    {
      Colour colour = colors[i];
      RGB customRGB = (RGB) usedColours.get(colour);

      RGB rgb = customRGB == null ? colour.getDefaultRGB() : customRGB;
      int dist = rgbDistance(awtColor, rgb);
      if (dist < minDist)
      {
        minDist = dist;
        minColour = colour;
      }

      if (dist == 0)//exact match
      {
        break;
      }

      if (customRGB == null)//the colour is not used
      {
        if (dist < minDistAvailable)
        {
          minDistAvailable = dist;
          minColourAvailable = colour;
        }
      }
    }

    Colour workbookColour;
    if (minDist == 0)//exact match found
    {
      if (!usedColours.containsKey(minColour))
      {
        //if the colour is not marked as used, mark it
View Full Code Here

Examples of jxl.format.Colour

    return workbookColour;
  }

  protected static Colour getNearestColour(Color awtColor)
  {
    Colour color = (Colour) colorsCache.get(awtColor);

    if (color == null)
    {
      Colour[] colors = Colour.getAllColours();
      if ((colors != null) && (colors.length > 0))
      {
        int minDiff = 999;

        for (int i = 0; i < colors.length; i++)
        {
          Colour crtColor = colors[i];
          int diff = rgbDistance(awtColor, crtColor.getDefaultRGB());

          if (diff < minDiff)
          {
            minDiff = diff;
            color = crtColor;
View Full Code Here

Examples of jxl.format.Colour

  protected void exportFrame(JRPrintFrame frame, JRExporterGridCell gridCell, int col, int row) throws JRException
  {
    addMergeRegion(gridCell, col, row);

    Colour forecolor = getWorkbookColour(frame.getForecolor());
    Colour backcolor = WHITE;
    Pattern mode = backgroundMode;

    if (frame.getModeValue() == ModeEnum.OPAQUE)
    {
      mode = Pattern.SOLID;
View Full Code Here

Examples of jxl.format.Colour

    // Initialize the array with all the default colours
    Colour[] colours = Colour.getAllColours();

    for (int i = 0; i < colours.length; i++)
    {
      Colour c = colours[i];
      setColourRGB(c,
                   c.getDefaultRGB().getRed(),
                   c.getDefaultRGB().getGreen(),
                   c.getDefaultRGB().getBlue());
    }
  }
View Full Code Here

Examples of jxl.format.Colour

   * @param hex a string which presents "#RRGGBB" 
   * @return colour a jxl.format.Colour object
   */
  public static jxl.format.Colour hexToJxlColour(String hex){
    // #RRGGBB
    Colour color = (Colour)_colourMap.get(hex);
    if(color == null)
      color = Colour.PALETTE_BLACK;
    return color;
  }
View Full Code Here

Examples of net.machinemuse.numina.geometry.Colour

        glTranslated(x, y, z);
        double scale = 0.0625;
        glScaled(scale, scale, scale);
        getFrameModel().renderAll();
        RenderState.glowOn();
        new Colour(entity.red, entity.green, entity.blue, 1.0).doGL();
        getLightModel().renderAll();
        RenderState.glowOff();
        glPopMatrix();
        MuseTextureUtils.popTexture();
    }
View Full Code Here

Examples of net.machinemuse.numina.geometry.Colour

    protected static DrawableMuseCircle circle2;
    protected static DrawableMuseCircle circle3;
    protected static DrawableMuseCircle circle4;

    public RenderPlasmaBolt() {
        Colour c1 = new Colour(.3, .3, 1, 0.3);
        circle1 = new DrawableMuseCircle(c1, c1);
        c1 = new Colour(.3, .3, 1, 0.6);
        circle2 = new DrawableMuseCircle(c1, c1);
        c1 = new Colour(.3, .3, 1, 1);
        circle3 = new DrawableMuseCircle(c1, c1);
        circle4 = new DrawableMuseCircle(c1, new Colour(1, 1, 1, 1));
    }
View Full Code Here

Examples of net.machinemuse.numina.geometry.Colour

        circle4.draw(1 + timeScale, 0, 0);
        for (int i = 0; i < 3; i++) {
            double angle1 = (Math.random() * 2 * Math.PI);
            double angle2 = (Math.random() * 2 * Math.PI);
            MuseRenderer.drawLightning(Math.cos(angle1) * 0.5, Math.sin(angle1) * 0.5, 0, Math.cos(angle2) * 5, Math.sin(angle2) * 5, 1,
                    new Colour(1, 1, 1, 0.9));
        }
        RenderState.glowOff();
        GL11.glPopMatrix();
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.