Extensibility > Graphics Builder Automation Interface > Text Property Functions > AttributeTextColour

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.

Syntax

AttributeTextColour(TextColour)

TextColour:

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

Example

' 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.

Published June 2018