Share via


ColorOperator.AdjustContrast(ColorValue,Single) Method (Microsoft.DirectX.Direct3D)

Adjusts the contrast value of a color.

Definition

Visual Basic Public Shared Function AdjustContrast( _
    ByVal c As ColorValue, _
    ByVal s As Single _
) As ColorValue
C# public static ColorValue AdjustContrast(
    ColorValue c,
    float s
);
C++ public:
static ColorValue AdjustContrast(
    ColorValue c,
    float s
);
JScript public static function AdjustContrast(
    c : ColorValue,
    s : float
) : ColorValue;

Parameters

c Microsoft.DirectX.Direct3D.ColorValue
A ColorValue object that specifies the color to adjust.
s System.Single
Floating-point value that represents the contrast value to apply to the given color. See Remarks.

Return Value

Microsoft.DirectX.Direct3D.ColorValue
A ColorValue object that represents the result of the contrast adjustment.

Remarks

The s parameter linearly interpolates between 50 percent gray and the color. There are no limits on the parameter's value. If the value is 0, the returned color is 50 percent gray. If the value is 1, the returned color is the original color. If s is greater than 0 and less than 1, the contrast is decreased; if it is greater than 1, the contrast is increased.

The input alpha channel is copied, unmodified, to the output alpha channel.