Admin Production ni-theme
Current Publication

MakeColor

LabWindows/CVI

MakeColor

int MakeColor (int red, int green, int blue);

Purpose

Generates a color (RGB) value from the individual constituent red, green, and blue intensity levels.

An RGB value is a 4-byte integer with the hexadecimal format 0x00RRGGBB. RR, GG, and BB are the respective red, green, and blue components of the color value. The first sixteen colors listed are the sixteen standard colors.

0xFF0000L = VAL_RED
0x00FF00L = VAL_GREEN
0x0000FFL = VAL_BLUE
0x00FFFFL = VAL_CYAN
0xFF00FFL = VAL_MAGENTA
0xFFFF00L = VAL_YELLOW
0x800000L = VAL_DK_RED
0x000080L = VAL_DK_BLUE
0x008000L = VAL_DK_GREEN
0x008080L = VAL_DK_CYAN
0x800080L = VAL_DK_MAGENTA
0x808000L = VAL_DK_YELLOW
0xC0C0C0L = VAL_LT_GRAY
0x808080L = VAL_DK_GRAY
0x000000L = VAL_BLACK
0xFFFFFFL = VAL_WHITE

0xA0A0A0L = VAL_GRAY
0xE0E0E0L = VAL_OFFWHITE
VAL_PANEL_GRAY = VAL_LT_GRAY

Parameters

Input
Name Type Description
red int Red level of the new color. Any integer value between 0 and 255 is valid.

0 = No red component
255 = Maximum red component
green int Green level of the new color. Any integer value between 0 and 255 is valid.

0 = No green component
255 = Maximum green component
blue int Blue level of the new color. Any integer value between 0 and 255 is valid.

0 = No blue component
255 = Maximum blue component

Return Value

Name Type Description
RGBValue int Return value indicating the RGB value. A negative number indicates that an error occurred.

Additional Information

Library: User Interface Library

Include file: userint.h

LabWindows/CVI compatibility: LabWindows/CVI 3.0 and later

Examples

Refer to the following examples that use the MakeColor function:

  • userint\canvas.cws

    Open example
  • userint\canvsbmk.cws

    Open example
  • userint\graphlegend.cws

    Open example
  • userint\GraphZooming.cws

    Open example
  • userint\gridview.cws

    Open example
  • userint\intgraph.cws

    Open example