---
title: "Graphics commands"
canonical: "https://docs.cuesystem.com/space/CVCHELP/518881382/Graphics%20commands"
format: markdown
---
> Macro (toc)

---

# Color

The function converts color components red, green, blue, and color opacity on the long number in a format compatible with other graphics functions. 

#### Syntax 

```visualbasic
Function Color( 
  red As Byte, 
  green As Byte, 
  blue As Byte, 
  opacity As Byte := 255) 
As Long
```

#### Parameters 

red 

<u>[Byte](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Byte)</u> It is the red component of the color. 

green 

<u>[Byte](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Byte)</u> It is the green component of the color. 

blue 

<u>[Byte](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Byte)</u> It is the blue component of the color. 

opacity 

<u>[Byte](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Byte)</u> Optional, defaults to 255. It is the opacity. 

#### Return value 

<u>[Long](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> It is the long type number of the color. 

# GetColorComponentBlue

The function returns a blue color component from a long type number returned by the **Color** function. 

#### Syntax 

```visualbasic
Function GetColorComponentBlue(color As Long) As Byte
```

#### Parameters 

color 

<u>[Long](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> It is the long type number of the color. 

#### Return value 

<u>[Byte](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Byte)</u> It is the blue component of the color. 

# GetColorComponentGreen

The function returns a green color component from a long type number returned by the **Color** function. 

#### Syntax 

```visualbasic
Function GetColorComponentGreen(color As Long) As Byte
```

#### Parameters 

color 

<u>[Long](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> It is the long type number of the color. 

#### Return value 

<u>[Byte](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Byte)</u> It is the green component of the color. 

# GetColorComponentOpacity

The function returns an opacity component from a long type number returned by the **Color** function. 

#### Syntax 

```visualbasic
Function GetColorComponentOpacity(color As Long) As Byte
```

#### Parameters 

color 

<u>[Long](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> It is the long type number of the color. 

#### Return value 

<u>[Byte](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Byte)</u> It is the opacity of the color. 

# GetColorComponentRed

The function returns a red color component from a long type number returned by the **Color** function. 

#### Syntax 

```visualbasic
Function GetColorComponentRed(color As Long) As Byte
```

#### Parameters 

color 

<u>[Long](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> It is the long type number of the color. 

#### Return value 

<u>[Byte](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Byte)</u> It is the red component of the color. 

# LockRedraw

The function suspends the drawing of graphic objects. It is mainly used in functions of graphic objects that affect the drawing by settings of any values. To avoid incomplete drawing, the **LockRedraw** function is called before the start of calculations. After completion of calculations, the **UnlockRedraw** function is called. Both functions must be called if really necessary and for the shortest time. Otherwise drawing can be blocked. 

#### Syntax 

```visualbasic
Function LockRedraw()
```

# SetColorComponentOpacity

The function returns a color with opacity. It is calculated from parameters **color** and **newopacity**. 

#### Syntax 

```visualbasic
Function SetColorComponentOpacity( 
  color As Long, 
  newopacity As Byte) 
As Long
```

#### Parameters 

color 

<u>[Long](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> It is the long type number of the color. 

newopacity 

<u>[Byte](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Byte)</u> It is the new opacity. 

#### Return value 

<u>[Long](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long)</u> It is the color with the new opacity. 

# UnlockRedraw

The function unlocks the drawing subsystem. If parameter **redrawimmediately=true**, then drawing is started as soon as possible. Optional flag **redrawimmediately** is used rarely, only if a quick reaction is required. 

#### Syntax* *

```visualbasic
Function UnlockRedraw(Optional redrawimmediately As Boolean := False)
```

#### Parameters 

redrawimmediately 

<u>[Boolean](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Boolean)</u> Optional, defaults to False. It specifies when the drawing is started. 

# Constants of basic colors

|  |  |  |
| --- | --- | --- |
| Name | Value RedGreenBlue | Description |
| _COLOR_BLACK | RGB(0, 0, 0) | Black. |
| _COLOR_WHITE | RGB(255, 255, 255) | White. |
| _COLOR_RED | RGB(255, 0, 0) | Red. |
| _COLOR_GREEN | RGB(0, 255, 0) | Green. |
| _COLOR_BLUE | RGB(0, 0, 255) | Blue. |
| _COLOR_YELLOW | RGB(255, 255, 0) | Yellow. |
| _COLOR_MAGENTA | RGB(255, 0, 255) | Magenta. |
| _COLOR_CYAN | RGB(0, 255, 255) | Cyan. |
| _COLOR_BROWN | RGB(165, 42, 42) | Brown. |
| _COLOR_GREY | RGB(128, 128, 128) | Grey. |