D3DXColorScale

Scales a color value.

D3DXCOLOR * D3DXColorScale(
  D3DXCOLOR * pOut,
  CONST D3DXCOLOR * pC,
  FLOAT s
);

Parameters

pOut
[in, out] Pointer to a D3DXCOLOR structure that is the result of the operation.
pC
[in] Pointer to a source D3DXCOLOR structure.
s
[in] Scale factor. It scales the color, treating it like a 4D vector. There are no limits on the value of s. If s is 1, the resulting color is the original color.

Return Values

This function returns a pointer to a D3DXCOLOR structure that is the scaled color value.

Remarks

The return value for this function is the same value returned in the pOut parameter. In this way, the D3DXColorScale function can be used as a parameter for another function.

This function computes the scaled color value by multiplying the color components of the D3DXCOLOR structure by the specified scale factor, as shown in the following example.

pOut->r = pC->r * s;

Requirements

Header: Declared in D3dx9math.h.

See Also

D3DXColorLerp, D3DXColorModulate, D3DXColorNegative