Most primitives provide standard properties to set their color and translucency. The color property should be set using the .NET ColorTranslator class as shown below:
using System.Drawing; IAgGxPrimitivePolyline line = new AgGxPrimitivePolyline(); line.Color = (uint)ColorTranslator.ToOle(Color.Honeydew);
Most primitives can be opaque or translucent (partially visible). This is controlled via the Translucency property. A Translucency of 0% means the primitive is completely opaque, while a Translucency of 100% means the primitive is completely transparent.
IAgGxPrimitivePolyline line = new AgGxPrimitivePolyline(); line.Translucency = 50;
Both the color and translucency can be set in a single call using the SetRGBA method. This uses red, green, blue and alpha components to define the primitive's color and translucency. All components are in the closed range 0 to 255, where 0 is least intense and 255 is most intense. The alpha component defines opaqueness, the opposite of translucency. A low alpha value means the primitive is mostly translucent and a high alpha means the primitive is mostly opaque.
IAgGxPrimitivePolyline line = new AgGxPrimitivePolyline(); line.SetRGBA(255, 0, 0, 127); // Translucent red