---
name: "XmGetColors"
section: "3"
platform: "linux"
package: "openmotif"
version: "2.3.8-4"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/XmGetColors"
---

# XmGetColors(3)

A function that generates foreground, select, and shadow colors

## NAME

**XmGetColors** — A function that generates foreground, select, and shadow colors

## SYNOPSIS

```
#include <Xm/Xm.h>
void XmGetColors(
Screen * screen,
Colormap colormap,
Pixel background,
Pixel * foreground,
Pixel * top_shadow,
Pixel * bottom_shadow,
Pixel * select);
```

## DESCRIPTION

**XmGetColors** takes a screen, a colormap, and a background pixel, and returns pixel values for foreground, select, and shadow colors.

- *screen*

  Specifies the screen for which these colors should be allocated.

- *colormap*

  Specifies the colormap from which these colors should be allocated.

- *background*

  Specifies the background on which the colors should be based.

- *foreground*

  Specifies a pointer to the returned foreground pixel value. If this argument is NULL, no value is allocated or returned for this color.

- *top\_shadow*

  Specifies a pointer to the returned top shadow pixel value. If this argument is NULL, no value is allocated or returned for this color.

- *bottom\_shadow*

  Specifies a pointer to the returned bottom shadow pixel value. If this argument is NULL, no value is allocated or returned for this color.

- *select*

  Specifies a pointer to the returned select pixel value. If this argument is NULL, no value is allocated or returned for this color.

## RELATED

[**XmChangeColor**(3)](/XmChangeColor/3.md), [**XmGetColorCalculation**(3)](/XmGetColorCalculation/3.md), and [**XmSetColorCalculation**(3)](/XmSetColorCalculation/3.md).
