Package java.awt

Examples of java.awt.Color


        float offX = Math.min(bw2, offsetX);
        app.saveState();
        app.rectangle(offX, offX, box.getWidth() - 2 * offX, box.getHeight() - 2 * offX);
        app.clip();
        app.newPath();
        Color fcolor = (textColor == null) ? GrayColor.GRAYBLACK : textColor;
        String ptext = text; //fixed by Kazuya Ujihara (ujihara.jp)
        if ((options & PASSWORD) != 0) {
            char[] pchar = new char[text.length()];
            for (int i = 0; i < text.length(); i++)
                pchar[i] = '*';
 
View Full Code Here


        topFirst = first;
        app.saveState();
        app.rectangle(offsetX, offsetX, box.getWidth() - 2 * offsetX, box.getHeight() - 2 * offsetX);
        app.clip();
        app.newPath();
        Color fcolor = (textColor == null) ? GrayColor.GRAYBLACK : textColor;
        app.setColorFill(new Color(10, 36, 106));
        app.rectangle(offsetX, offsetX + h - (topChoice - first + 1) * leading, box.getWidth() - 2 * offsetX, leading);
        app.fill();
        float xp = offsetX * 2;
        float yp = offsetX + h - ufont.getFontDescriptor(BaseFont.BBOXURY, usize);
        for (int idx = first; idx < last; ++idx, yp -= leading) {
View Full Code Here

   *            the green-value of the new color
   * @param blue
   *            the blue-value of the new color
   */
  public void setColor(int red, int green, int blue) {
    this.color = new Color(red, green, blue);
  }
View Full Code Here

      if (style2 == UNDEFINED)
        style2 = 0;
      dStyle = style1 | style2;
    }
    // color
    Color dColor = font.color;
    if (dColor == null) {
      dColor = this.color;
    }
    // family
    if (font.baseFont != null) {
View Full Code Here

      public void mouseEntered(MouseEvent e) {
        int r = (getForeground().getRed()   + getBackground().getRed())   >> 1;
        int g = (getForeground().getGreen() + getBackground().getGreen()) >> 1;
        int b = (getForeground().getBlue()  + getBackground().getBlue())  >> 1;
       
        e.getComponent().setForeground(new Color(r,g,b));
      }
     
      public void mouseExited(MouseEvent e) {
        e.getComponent().setForeground(UIManager.getColor("List.selectionForeground"));
      }
View Full Code Here

                    else if (operator.equals("rg")) {
                        if (stack.size() >= 3) {
                            float red = new Float((String)stack.get(stack.size() - 3)).floatValue();
                            float green = new Float((String)stack.get(stack.size() - 2)).floatValue();
                            float blue = new Float((String)stack.get(stack.size() - 1)).floatValue();
                            ret[DA_COLOR] = new Color(red, green, blue);
                        }
                    }
                    else if (operator.equals("k")) {
                        if (stack.size() >= 4) {
                            float cyan = new Float((String)stack.get(stack.size() - 4)).floatValue();
View Full Code Here

        }
        //rotation, border and background color
        PdfDictionary mk = (PdfDictionary)PdfReader.getPdfObject(merged.get(PdfName.MK));
        if (mk != null) {
            PdfArray ar = (PdfArray)PdfReader.getPdfObject(mk.get(PdfName.BC));
            Color border = getMKColor(ar);
            tx.setBorderColor(border);
            if (border != null)
                tx.setBorderWidth(1);
            ar = (PdfArray)PdfReader.getPdfObject(mk.get(PdfName.BG));
            tx.setBackgroundColor(getMKColor(ar));
View Full Code Here

        ArrayList cc = ar.getArrayList();
        switch (cc.size()) {
            case 1:
                return new GrayColor(((PdfNumber)cc.get(0)).floatValue());
            case 3:
                return new Color(ExtendedColor.normalize(((PdfNumber)cc.get(0)).floatValue()), ExtendedColor.normalize(((PdfNumber)cc.get(1)).floatValue()), ExtendedColor.normalize(((PdfNumber)cc.get(2)).floatValue()));
            case 4:
                return new CMYKColor(((PdfNumber)cc.get(0)).floatValue(), ((PdfNumber)cc.get(1)).floatValue(), ((PdfNumber)cc.get(2)).floatValue(), ((PdfNumber)cc.get(3)).floatValue());
            default:
                return null;
        }
View Full Code Here

    setPreferredSize(new Dimension(prefWidth, prefHeight));
 
    fadeStop = (float) (About.IMAGE_HEIGHT / 4.0);

    colorBase = new Color[] {
        new Color(143, 0, 0),
        new Color(48, 0, 96),
        new Color(48, 0, 96),
    };
    font = new Font[] {
        new Font("Sans Serif", Font.ITALIC, 20),
        new Font("Sans Serif", Font.BOLD, 24),
        new Font("Sans Serif", Font.BOLD, 18),
    };
    paintSteady = new Paint[colorBase.length];
    for (int i = 0; i < colorBase.length; i++) {
      Color hue = colorBase[i];
      paintSteady[i] = new GradientPaint(0.0f, 0.0f, derive(hue, 0),
          0.0f, fadeStop, hue);
    }
   
    URL url = AboutCredits.class.getClassLoader().getResource(HENDRIX_PATH);
View Full Code Here

    scroll = value;
    repaint();
  }
 
  private Color derive(Color base, int alpha) {
    return new Color(base.getRed(), base.getGreen(), base.getBlue(), alpha);
  }
View Full Code Here

TOP

Related Classes of java.awt.Color

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.