ObjectDCL Banner

GetColorValue Method

Description

This method will return the color value specified from the arguments. The RedOrColorIndex can be set as 1 to 255 for an AutoCAD color or -1 to -23 for a system color. If you need to create a different color, set the red, green and blue values from 0 to 256. The value from this method is only useful for setting colors of ActiveX controls.

The first argument is an integer that indicates the AutoCAD color index, system color or red value. If red is supplied then the green and blue arguments must be supplied.

Parameters

RedOrColorIndex
Integer specifying the color index or the red component.
Green
Integer specifying the green component.
Blue
Integer specifying the blue component.

Return Values

Returns the following according to the situation:

  • Color when successful.
  • Nil if the color specification is incomplete.

AutoLISP Syntax

CopyCode imageCopy Code
(Odcl_Control_GetColorValue 
		RedOrColorIndex [as Integer]
		[Optional] Green [as Integer]
		[Optional] Blue [as Integer])

Example

CopyCode imageCopy Code
; Get the system color
(Odcl_Control_GetColorValue -5)

; Get the RGB color
(Odcl_Control_GetColorValue 128 128 255)

See Also

ActiveX