Managing colors
- Last Updated: January 17, 2024
- 1 minute read
- OpenEdge
- Version 12.8
- Documentation
COM objects accept color specifications in the form
of an RGB (Red/Green/Blue) integer value. However, ABL widgets accept
color specifications in the form of an integer index into a color
table managed by the COLOR-TABLE system handle.
To support color management for COM objects, ABL provides techniques
that work with or without the ABL color table.
ABL provides three ways to obtain a color value to set colors for a COM object:
- Use the value from the property or method of another COM object.
- Use the
GET-RGB-VALUE( )method of theCOLOR-TABLEsystem handle. - Use the
RGB-VALUEfunction.
To use a color value from another COM object, simply assign the color value returned by one of its properties or methods to a color property or as a method parameter of your Automation object or ActiveX control.
To use the GET-RGB-VALUE( ) method, pass it
an index to a color stored in the ABL color table and the method
returns an integer that represents the RGB value of the specified
color. You can then assign this value to a COM object color property.
For example:
|
This example assigns the RGB value of color number 5 from the color table to the BorderColor property of myObject.
To use the RGB-VALUE function, you pass the
function three color values between 0 and 255 and it returns a single
RGB value that represents the color. For example:
|