Examples of GrayColor


Examples of com.lowagie.text.pdf.GrayColor

            cb.rectangle(150, 400, 30, 100);
            cb.fillStroke();
            cb.setPatternFill(pat2, Color.blue);
            cb.rectangle(200, 400, 30, 130);
            cb.fillStroke();
            cb.setPatternFill(pat2, new GrayColor(0.5f));
            cb.rectangle(250, 400, 30, 80);
            cb.fillStroke();
            cb.setPatternFill(pat2, new GrayColor(0.7f));
            cb.rectangle(300, 400, 30, 170);
            cb.fillStroke();
            cb.setPatternFill(pat2, new GrayColor(0.9f));
            cb.rectangle(350, 400, 30, 40);
            cb.fillStroke();
           
            cb.sanityCheck();
        }
View Full Code Here

Examples of com.lowagie.text.pdf.GrayColor

            BaseFont helv = BaseFont.createFont("Helvetica", "winansi", false);
            PdfContentByte cb = writer.getDirectContent();
            cb.moveTo(0, 0);
            String text = "Some start text";
            float fontSize = 12;
            Color textColor = new GrayColor(0f);
            PdfFormField field = PdfFormField.createTextField(writer, false, false, 0);
            field.setWidget(new LwgRectangle(171, 750, 342, 769), PdfAnnotation.HIGHLIGHT_INVERT);
            field.setFlags(PdfAnnotation.FLAGS_PRINT);
            field.setFieldName("ATextField");
            field.setValueAsString(text);
View Full Code Here

Examples of com.lowagie.text.pdf.GrayColor

   * Sets the the background color to a grayscale value.
   *
   * @param value  the new grayscale value
   */
  public void setGrayFill(float value) {
        backgroundColor = new GrayColor(value);
  }
View Full Code Here

Examples of com.lowagie.text.pdf.GrayColor

   *
   * @param value
   *            the new value
   */
  public void setGrayFill(float value) {
        backgroundColor = new GrayColor(value);
  }
View Full Code Here

Examples of com.lowagie.text.pdf.GrayColor

            BaseFont helv = BaseFont.createFont("Helvetica", "winansi", false);
            PdfContentByte cb = writer.getDirectContent();
            cb.moveTo(0, 0);
            String text = "Some start text";
            float fontSize = 12;
            Color textColor = new GrayColor(0f);
            PdfFormField field = PdfFormField.createTextField(writer, false, false, 0);
            field.setWidget(new Rectangle(171, 750, 342, 769), PdfAnnotation.HIGHLIGHT_INVERT);
            field.setFlags(PdfAnnotation.FLAGS_PRINT);
            field.setFieldName("ATextField");
            field.setValueAsString(text);
View Full Code Here

Examples of com.lowagie.text.pdf.GrayColor

            cb.rectangle(150, 400, 30, 100);
            cb.fillStroke();
            cb.setPatternFill(pat2, Color.blue);
            cb.rectangle(200, 400, 30, 130);
            cb.fillStroke();
            cb.setPatternFill(pat2, new GrayColor(0.5f));
            cb.rectangle(250, 400, 30, 80);
            cb.fillStroke();
            cb.setPatternFill(pat2, new GrayColor(0.7f));
            cb.rectangle(300, 400, 30, 170);
            cb.fillStroke();
            cb.setPatternFill(pat2, new GrayColor(0.9f));
            cb.rectangle(350, 400, 30, 40);
            cb.fillStroke();
           
            cb.sanityCheck();
        }
View Full Code Here

Examples of com.lowagie.text.pdf.GrayColor

            // step 5: we instantiate PdfSpotColor
           
            // Note: I made up these names unless someone give me a PANTONE swatch as gift (phillip@formstar.com)
            PdfSpotColor spc_cmyk = new PdfSpotColor("PANTONE 280 CV", new CMYKColor(0.9f, .2f, .3f, .1f));
            PdfSpotColor spc_rgb = new PdfSpotColor("PANTONE 147", new Color(114, 94, 38));
            PdfSpotColor spc_g = new PdfSpotColor("PANTONE 100 CV", new GrayColor(0.9f));
           
            // Stroke a rectangle with CMYK alternate
            cb.setColorStroke(spc_cmyk, .5f);
            cb.setLineWidth(10f);
            // draw a rectangle
View Full Code Here

Examples of com.lowagie.text.pdf.GrayColor

            // See if we can apply the pattern color to chunk, phrase or paragraph
            PatternColor pat = new PatternColor(p);
            PatternColor pat1 = new PatternColor(p1);
            PatternColor pat2 = new PatternColor(p2);
            String text = "Text with pattern";
            document.add(new Paragraph(text, FontFactory.getFont(FontFactory.HELVETICA, 60, Font.BOLD, new GrayColor(0.3f))));
            document.add(new Paragraph(text, FontFactory.getFont(FontFactory.HELVETICA, 60, Font.BOLD, pat)));
           
            // draw a rectangle filled with star pattern
            cb.setPatternFill(p);
            cb.setGrayStroke(0.0f);
            cb.rectangle(20, 20, 284, 120);
            cb.fillStroke();
           
            // draw some characters filled with star.
            // Note: A gray, rgb, cmyk or spot color should be applied first
            // otherwise, you will not be able to see the character glyph
            // since the glyph path is filled by pattern
            cb.beginText();
            cb.setFontAndSize(bf, 1);
            cb.setTextMatrix(270f, 0f, 0f, 270f, 20f, 100f);
            cb.setGrayFill(0.9f);
            cb.showText("ABC");
            cb.setPatternFill(p);
            cb.moveTextWithLeading(0.0f, 0.0f);
            cb.showText("ABC");
            cb.endText();
            cb.setPatternFill(p);
           
            // draw a circle. Similar to rectangle
            cb.setGrayStroke(0.0f);
            cb.circle(150f, 400f, 150f);
            cb.fillStroke();
           
            // New Page to draw text in the pattern painter's canvas
            document.newPage();
           
            document.add(new Paragraph(text, FontFactory.getFont(FontFactory.HELVETICA, 60, Font.BOLD, new GrayColor(0.3f))));
            document.add(new Paragraph(text, FontFactory.getFont(FontFactory.HELVETICA, 60, Font.BOLD, pat1)));
            // draw a rectangle
            cb.setPatternFill(p1);
            cb.setGrayStroke(0.0f);
            cb.rectangle(0, 0, 284, 120);
            cb.fillStroke();
           
            // draw some characters
            cb.beginText();
            cb.setFontAndSize(bf, 1);
            cb.setTextMatrix(270f, 0f, 0f, 270f, 20f, 100f);
            cb.setGrayFill(0.9f);
            cb.showText("ABC");
            cb.setPatternFill(p1);
            cb.moveTextWithLeading(0.0f, 0.0f);
            cb.showText("ABC");
            cb.endText();
           
            // draw a circle
            cb.setPatternFill(p1);
            cb.setGrayStroke(0.0f);
            cb.circle(150f, 400f, 150f);
            cb.fillStroke();
            cb.sanityCheck();
           
            // New page to place image in the pattern painter's canvas
            document.newPage();
            document.add(new Paragraph(text, FontFactory.getFont(FontFactory.HELVETICA, 60, Font.BOLD, new GrayColor(0.3f))));
            document.add(new Paragraph(text, FontFactory.getFont(FontFactory.HELVETICA, 60, Font.BOLD, pat2)));
            // The original Image for comparison reason.
            // Note: The width and height is the same as bbox in pattern
            cb.addImage(img, img.getScaledWidth(), 0f, 0f, img.getScaledHeight(), 350f, 400f);
           
View Full Code Here

Examples of com.scriptographer.ai.GrayColor

            reader.readFloat(0),
            reader.readFloat(0)
        );
      } else  if (size == 1) {
        // Gray
        return new GrayColor(
            reader.readFloat(0)
        );
      }
    } else if (reader.isMap()) {
      if (reader.has("red")) {
        return new RGBColor(
            reader.readFloat("red", 0),
            reader.readFloat("green", 0),
            reader.readFloat("blue", 0),
            reader.readFloat("alpha", 1)
        );
      } else if (reader.has("cyan")) {
        return new CMYKColor(
            reader.readFloat("cyan", 0),
            reader.readFloat("magenta", 0),
            reader.readFloat("yellow", 0),
            reader.readFloat("black", 0),
            reader.readFloat("alpha", 1)
        );
      } else if (reader.has("gray")) {
        return new GrayColor(
            reader.readFloat("gray", 0),
            reader.readFloat("alpha", 1)
        );
      }
    }
View Full Code Here

Examples of org.jrebirth.af.core.resource.color.GrayColor

        checkGrayColor(TestColors.TEST_COLOR_GRAY_3);
    }

    private void checkGrayColor(final ColorItem colorItem) {
        final Color color = colorItem.get();
        final GrayColor wc = (GrayColor) ResourceBuilders.COLOR_BUILDER.getParam(colorItem);

        // compareRoundedValues(color.getRed(), convert255To1(wc.hex().substring(0, 2)));
        // compareRoundedValues(color.getGreen(), convert255To1(wc.hex().substring(2, 4)));
        // compareRoundedValues(color.getBlue(), convert255To1(wc.hex().substring(4, 6)));

        assertEquals(color.getOpacity(), wc.opacity(), 0.1);

    }
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.