public class Color extends Object
Represents the colorspaces used in Aspose.Pdf.Generator including
RgbColorSpace
, CmykColorSpace
and GrayColorSpace
.
[C#] Pdf pdf1 = new Pdf(); Section sec1 = pdf1.Sections.Add(); Graph graph1 = new Graph(sec1,200,400); sec1.Paragraphs.Add(graph1); float[] posArr = new float[]{100,0,300,0}; Line l1 = new Line(graph1,posArr); l1.GraphInfo.Color = new Aspose.Pdf.Generator.Color("Red"); graph1.Shapes.Add(l1); posArr = new float[]{100,50,300,50}; Line l2 = new Line(graph1,posArr); l2.GraphInfo.Color = new Aspose.Pdf.Generator.Color(0,128,128); graph1.Shapes.Add(l2); posArr = new float[]{100,100,300,100}; Line l3 = new Line(graph1,posArr); l3.GraphInfo.Color = new Aspose.Pdf.Generator.Color(0,128,64,0); graph1.Shapes.Add(l3); posArr = new float[]{100,150,300,150}; Line l4 = new Line(graph1,posArr); l4.GraphInfo.Color = new Aspose.Pdf.Generator.Color((byte)140); graph1.Shapes.Add(l4); pdf1.Save(...); [Visual Basic] Dim pdf1 As Pdf = New Pdf() Dim sec1 As Section = pdf1.Sections.Add() Dim graph1 As Graph = New Graph(sec1, 200, 400) sec1.Paragraphs.Add(graph1) Dim posArr As Single() = New Single() {100, 0, 300, 0} Dim l1 As Line = New Line(graph1, posArr) l1.GraphInfo.Color = New Aspose.Pdf.Generator.Color("Red") graph1.Shapes.Add(l1) posArr = New Single() {100, 50, 300, 50} Dim l2 As Line = New Line(graph1, posArr) l2.GraphInfo.Color = New Aspose.Pdf.Generator.Color(0, 128, 128) graph1.Shapes.Add(l2) posArr = New Single() {100, 100, 300, 100} Dim l3 As Line = New Line(graph1, posArr) l3.GraphInfo.Color = New Aspose.Pdf.Generator.Color(0, 128, 64, 0) graph1.Shapes.Add(l3) posArr = New Single() {100, 150, 300, 150} Dim l4 As Line = New Line(graph1, posArr) l4.GraphInfo.Color = New Aspose.Pdf.Generator.Color(CType(140,Byte)) graph1.Shapes.Add(l4) pdf1.Save(...) [XML] <?xml version="1.0" encoding="utf-8" ?> <Pdf xmlns="Aspose.Pdf"> <Section> <Graph Height="200" Width="400"> <Line Color="Red" Position="100 0 300 0" /> <Line Color="rgb 0 128 128" Position="100 50 300 50" /> <Line Color="cmyk 0 128 64 0" Position="100 100 300 100" /> <Line Color="gray 140" Position="100 150 300 150" /> </Graph> </Section> </Pdf>
Constructor and Description |
---|
Color()
Initializes a new instance of the
Color class. |
Color(byte grayValue)
Initializes a new instance of the
Color class with
GrayColorSpace . |
Color(byte r,
byte g,
byte b)
Initializes a new instance of the
Color class with
RgbColorSpace. |
Color(byte c,
byte m,
byte y,
byte k)
Initializes a new instance of the
Color class with
CmykColorSpace . |
Color(com.aspose.ms.System.Drawing.Color netColor) |
Color(int r,
int g,
int b) |
Color(String colorName)
Initializes a new instance of the
Color class with
RgbColorSpace from specified color name. |
Modifier and Type | Method and Description |
---|---|
Object |
deepClone() |
CmykColorSpace |
getCmykColorSpace()
Represents a
CmykColorSpace object that indicates the CMYK
colorspace. |
int |
getColorSpaceType()
Represents a
ColorSpaceType object that indicates the
colorspace type. |
GrayColorSpace |
getGrayColorSpace()
Represents a
GrayColorSpace object that indicates the gray
colorspace. |
PatternColorSpace |
getPatternColorSpace()
Represents a
GrayColorSpace object that indicates the pattern
colorspace. |
Color |
getRgbColorSpace() |
com.aspose.ms.System.Drawing.Color |
getRgbColorSpaceInternal() |
boolean |
isNotNullAndSameAs(Color color) |
void |
setCmykColorSpace(CmykColorSpace value)
Represents a
CmykColorSpace object that indicates the CMYK
colorspace. |
void |
setColorSpaceType(int value) |
void |
setGrayColorSpace(GrayColorSpace value) |
void |
setPatternColorSpace(PatternColorSpace value) |
void |
setRgbColorSpace(Color value) |
void |
setRgbColorSpaceInternal(com.aspose.ms.System.Drawing.Color value) |
String |
toPdfRepresentation(boolean forStrokeOperations) |
public Color()
Initializes a new instance of the Color
class.
public Color(byte grayValue)
Initializes a new instance of the Color
class with
GrayColorSpace
.
grayValue
- The gray value of the gray colorspace.public Color(byte r, byte g, byte b)
Initializes a new instance of the Color
class with
RgbColorSpace.
r
- The red color value.g
- The green color value.b
- The blue color value.public Color(int r, int g, int b)
public Color(com.aspose.ms.System.Drawing.Color netColor)
public Color(byte c, byte m, byte y, byte k)
Initializes a new instance of the Color
class with
CmykColorSpace
.
c
- The cyan value.m
- The magenta value.y
- The yellow value.k
- The black value.public Color(String colorName)
Initializes a new instance of the Color
class with
RgbColorSpace from specified color name.
colorName
- The color name. It can be any name in
System.Drawing.Color or format like '#0000ff'.public int getColorSpaceType()
Represents a ColorSpaceType
object that indicates the
colorspace type.
public void setColorSpaceType(int value)
public com.aspose.ms.System.Drawing.Color getRgbColorSpaceInternal()
public Color getRgbColorSpace()
public void setRgbColorSpaceInternal(com.aspose.ms.System.Drawing.Color value)
public void setRgbColorSpace(Color value)
public CmykColorSpace getCmykColorSpace()
Represents a CmykColorSpace
object that indicates the CMYK
colorspace. Note that you can use the
aspose.pdf.Color(byte,byte,byte,byte)
constructor to create a
color object with CMYK colorspace and need not use this class directly.
public void setCmykColorSpace(CmykColorSpace value)
Represents a CmykColorSpace
object that indicates the CMYK
colorspace. Note that you can use the
aspose.pdf.Color(byte,byte,byte,byte)
constructor to create a
color object with CMYK colorspace and need not use this class directly.
public GrayColorSpace getGrayColorSpace()
Represents a GrayColorSpace
object that indicates the gray
colorspace. Note that you can use the aspose.pdf.Color(byte)
constructor to create a color object with gray colorspace and need not
use this class directly.
public void setGrayColorSpace(GrayColorSpace value)
public PatternColorSpace getPatternColorSpace()
Represents a GrayColorSpace
object that indicates the pattern
colorspace.
public void setPatternColorSpace(PatternColorSpace value)
public Object deepClone()
public boolean isNotNullAndSameAs(Color color)
public String toPdfRepresentation(boolean forStrokeOperations)
Copyright © 2016 Aspose. All Rights Reserved.