XMColorRGBToHSL 函数 (directxmath.h)

将 RGB 颜色值转换为 HSL 颜色值。

语法

XMVECTOR XM_CALLCONV XMColorRGBToHSL(
  [in] FXMVECTOR rgb
) noexcept;

参数

[in] rgb

要转换的颜色值。 X 元素为 Red,Y 元素为 Green,Z 元素为 Blue,W 元素为 Alpha。 每个的范围为 0.0 到 1.0。

返回值

返回转换后的颜色值。 X 元素为 Hue (H) ,Y 元素为饱和度 (S) ,Z 元素为 Luminance (L) ,W 元素为 Alpha (输入的 Alpha 值) 的副本。 每个的范围为 0.0 到 1.0。

备注

注意XMColorRGBToHSL 是 DirectXMath 的新增功能,不适用于 XNAMath 2.x。
 

平台要求

带有 Windows SDK for Windows 8 的 Microsoft Visual Studio 2010 或 Microsoft Visual Studio 2012。 支持 Win32 桌面应用、Windows 应用商店应用和 Windows Phone 8 应用。

要求

   
目标平台 Windows
标头 directxmath.h

请参阅

DirectXMath 库颜色函数

XMColorHSLToRGB