XMColorNegative 函式 (directxmath.h)

決定色彩的負 RGB 色彩值。

語法

XMVECTOR XM_CALLCONV XMColorNegative(
  [in] FXMVECTOR C
) noexcept;

參數

[in] C

描述色彩的 XMVECTORC 的每個元件都應該在 0.0f 到 1.0f 的範圍內。

傳回值

傳回描述負色的 XMVECTOR 。 w 元件 (alpha) 會從輸入向量中複製。

備註

下列虛擬程式代碼會顯示函式的作業。

XMVECTOR colorOut;

colorOut.x = 1.0f - C.x;
colorOut.y = 1.0f - C.y;
colorOut.z = 1.0f - C.z;
colorOut.w = C.w;

return colorOut;

平臺需求

Microsoft Visual Studio 2010 或 Microsoft Visual Studio 2012 搭配 Windows SDK for Windows 8。 支援 Win32 傳統型應用程式、Windows 市集應用程式和 Windows Phone 8 個應用程式。

規格需求

需求
目標平台 Windows
標頭 directxmath.h

另請參閱

DirectXMath 連結庫色彩函式