Technical Reference > Graphics Builder Automation Interface > Text Property Functions > AttributeTextColour


Applies a color to the selected text, or retrieves the current font color setting.

Note: As this function does not support True Color functionality, it has been superseded by the functions AttributeTextOnColourEx and AttributeTextOffColourEx.




A value between 0 and 255 representing the font color.

Return Value

If retrieving the current font color, a value between 0 and 255. If applying a particular font color, 0 (zero) if successful. In both cases, an error is returned if unsuccessful. If values are out of range on writing to the attribute, the function exits and reports the error E_INVALIDARG. If there is no active text object, these functions throw an exception with a return value of E_HANDLE.

Note: For details on handling return and error values, see Error Handling.

Related Functions

AttributeText, AttributeTextStyle, AttributeTextJustification, AttributeTextFont, AttributeTextFontSize


' Applies a color to the selected text
GraphicsBuilder.AttributeTextColour = 255

`Retrieves the current font color setting
MyVariable = GraphicsBuilder.AttributeTextColour

This function is implemented in the C++ environment as two separate functions: put_AttributeTextColour applies a color to the currently selected text, and get_AttributeTextColour retrieves the current text color.