com.esri.arcgis.display
Interface IColor

All Superinterfaces:
Serializable
All Known Subinterfaces:
ICmykColor, IGrayColor, IHlsColor, IHsvColor, IRgbColor
All Known Implementing Classes:
CmykColor, GrayColor, HlsColor, HsvColor, RgbColor

public interface IColor
extends Serializable

Provides access to members that control the basic color interface.

Description

IColor is a generic interface that are implemented by all the other color CoClasses. IColor is also where transparency is managed. The other color interfaces derived from IColor interface are: IRgbColor, ICmykColor, IHsvColor, IHlsColor, and IGrayColor. You can also convert any of the color interfaces to OLE color objects by using the RGB method.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

See Also:
ICmykColor, IColor, IEnumColors, ICieLabConversion

Method Summary
 void getCIELAB(double[] l, double[] a, double[] b)
          The CIELAB value of color.
 int getCMYK()
          The CMYK value of color.
 int getRGB()
          The RGB value of color.
 byte getTransparency()
          The Alpha Blending value.
 boolean isNullColor()
          Indicates whether this color is null.
 boolean isUseWindowsDithering()
          Indicates if colors should be dithered to simulate colors that aren't supported by the display.
 void setCIELAB(double l, double a, double b)
          The CIELAB value of color.
 void setCMYK(int cMYK)
          The CMYK value of color.
 void setNullColor(boolean flag)
          Indicates whether this color is null.
 void setRGB(int rGB)
          The RGB value of color.
 void setTransparency(byte alphaValue)
          The Alpha Blending value.
 void setUseWindowsDithering(boolean useDithering)
          Indicates if colors should be dithered to simulate colors that aren't supported by the display.
 

Method Detail

setRGB

void setRGB(int rGB)
            throws IOException,
                   AutomationException
The RGB value of color.

Description

RGB returns Long (ASCII) number calculated from the Red, Green and Blue color attributes.

Remarks

Set the UseWindowsDithering to TRUE to match the returned value from VB's RGB() function.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Parameters:
rGB - The rGB (A COM typedef) (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:

It is easiest to specify the rgb values in hexadecimal. The following code creates an RGBColor for black -

RGBColor black = new RGBColor();

black.setRGB(0xFFFFFF);


getRGB

int getRGB()
           throws IOException,
                  AutomationException
The RGB value of color.

Description

RGB returns the Long (ASCII) number calculated from the Red, Green and Blue color attributes.

Remarks

Set the UseWindowsDithering to TRUE to match the returned value from VB's RGB() function.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Returns:
The rGB (A COM typedef)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setCMYK

void setCMYK(int cMYK)
             throws IOException,
                    AutomationException
The CMYK value of color.

Description

CMYK returns the Long (ASCII) number calculated from the Cyan, Magenta, Yellow and Black color attributes.

Remarks

C = 0 - 100 ;M = 0 - 100; Y = 0 - 100; K = 0 - 100

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Parameters:
cMYK - The cMYK (A COM typedef) (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getCMYK

int getCMYK()
            throws IOException,
                   AutomationException
The CMYK value of color.

Description

CMYK returns the Long (ASCII) number calculated from the Cyan, Magenta, Yellow and Black color attributes.

Remarks

C = 0 - 100 ;M = 0 - 100; Y = 0 - 100; K = 0 - 100

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Returns:
The cMYK (A COM typedef)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setUseWindowsDithering

void setUseWindowsDithering(boolean useDithering)
                            throws IOException,
                                   AutomationException
Indicates if colors should be dithered to simulate colors that aren't supported by the display. This only applies on displays that have 256 or fewer colors.

Remarks

Set UseWindowsDithering to TRUE to match the returned value from VB's RGB() function.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Parameters:
useDithering - The useDithering (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

isUseWindowsDithering

boolean isUseWindowsDithering()
                              throws IOException,
                                     AutomationException
Indicates if colors should be dithered to simulate colors that aren't supported by the display. This only applies on displays that have 256 or fewer colors.

Remarks

Set UseWindowsDithering to TRUE to match the returned value from VB's RGB() function.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Returns:
The useDithering
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setCIELAB

void setCIELAB(double l,
               double a,
               double b)
               throws IOException,
                      AutomationException
The CIELAB value of color.

Description

This method converts the color attributes to device independent color.

Remarks

l = 0 to 100, a = -120 to 120, b = -120 to 120

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Parameters:
l - The l (in)
a - The a (in)
b - The b (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getCIELAB

void getCIELAB(double[] l,
               double[] a,
               double[] b)
               throws IOException,
                      AutomationException
The CIELAB value of color.

Description

This method retrieves the color, for exmaple from StyleGallery, and convert it to device independent color attributes.

Remarks

l = 0 to 100, a = -120 to 120, b = -120 to 120

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Parameters:
l - The l (out: use single element array)
a - The a (out: use single element array)
b - The b (out: use single element array)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setTransparency

void setTransparency(byte alphaValue)
                     throws IOException,
                            AutomationException
The Alpha Blending value. (0 for transparent, 255 for opaque).

Description

Transparency is the degree to which a color is opaque. True transparency is only supported at the layer level. For graphic elements, 0 for transparent and 255 for opaque are the only supported values. Use either the ILayerEffects or ITransparencyRenderer interfaces to set layer transparency. For layer transparency to work properly the display device must be set to "True Color (32 bit)".

Remarks

Setting this property has no effect when defining transparency for a GeometryMaterial participating in a MultiPatch generated via IGeneralMultiPatchCreator. Use the Transparency property exposed by IGeometryMaterial instead.

The default value is 255.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Parameters:
alphaValue - An unsigned byte (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getTransparency

byte getTransparency()
                     throws IOException,
                            AutomationException
The Alpha Blending value. (0 for transparent, 255 for opaque).

Description

Transparency is the degree to which a color is opaque. True transparency is only supported at the layer level. For graphic elements, 0 for transparent and 255 for opaque are the only supported values. Use either the ILayerEffects or ITransparencyRenderer interfaces to set layer transparency. For layer transparency to work properly the display device must be set to "True Color (32 bit)".

Remarks

The default value is 255.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Returns:
An unsigned byte
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setNullColor

void setNullColor(boolean flag)
                  throws IOException,
                         AutomationException
Indicates whether this color is null.

Description

Boolean indicator that specifies if the color will be Null or Transparent. The default for NullColor is False.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Parameters:
flag - The flag (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

isNullColor

boolean isNullColor()
                    throws IOException,
                           AutomationException
Indicates whether this color is null.

Description

Boolean indicator that specifies if the color will be Null or Transparent. The default for NullColor is False.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Returns:
The flag
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.