World of Warcraft Forever API · C_ColorUtil.md, for your AI
C_ColorUtil
7 functions, as Blizzard documents them for Forever 1.60.1 (70959).
Making an addon with an AI? Tell it: Read https://wowaddons.gg/agents.md, then make me a World of Warcraft Forever addon that …, try it with me in the game, and publish it. It checks every call against this API before you try it in the game, then publishes it here. How it works.
Functions
C_ColorUtil.ConvertHSLToHSV
hsvH, hsvS, hsvV = C_ColorUtil.ConvertHSLToHSV(hslH, hslS, hslL)
Converts an unpacked HSL color to HSV.
Arguments
hslH | number | |
|---|---|---|
hslS | number | |
hslL | number |
Returns
hsvH | number | |
|---|---|---|
hsvS | number | |
hsvV | number |
C_ColorUtil.ConvertHSVToHSL
hslH, hslS, hslL = C_ColorUtil.ConvertHSVToHSL(hsvH, hsvS, hsvV)
Converts an unpacked HSV color to HSL.
Arguments
hsvH | number | |
|---|---|---|
hsvS | number | |
hsvV | number |
Returns
hslH | number | |
|---|---|---|
hslS | number | |
hslL | number |
C_ColorUtil.ConvertHSVToRGB
rgbR, rgbG, rgbB = C_ColorUtil.ConvertHSVToRGB(hsvH, hsvS, hsvV)
Converts an unpacked HSV color to RGB.
Arguments
hsvH | number | |
|---|---|---|
hsvS | number | |
hsvV | number |
Returns
rgbR | number | |
|---|---|---|
rgbG | number | |
rgbB | number |
C_ColorUtil.ConvertRGBToHSV
hsvH, hsvS, hsvV = C_ColorUtil.ConvertRGBToHSV(rgbR, rgbG, rgbB)
Converts an unpacked RGB color to HSV. For achromatic inputs, the returned hue will be -1.
Arguments
rgbR | number | |
|---|---|---|
rgbG | number | |
rgbB | number |
Returns
hsvH | number | |
|---|---|---|
hsvS | number | |
hsvV | number |
C_ColorUtil.GenerateTextColorCode
textColorCode = C_ColorUtil.GenerateTextColorCode(color)
Generates a hex color code suitable for use in text color code markup.
Arguments
color | colorRGB | Color to generate a hex color code from. |
|---|
Returns
textColorCode | string | Hex representation of the color formatted as an 8-byte ARGB string, with alpha forced to 255. |
|---|
C_ColorUtil.WrapTextInColor
coloredText = C_ColorUtil.WrapTextInColor(text, color)
Wraps a given string with color code markup.
Arguments
text | cstring | Text to be wrapped in color markup. |
|---|---|---|
color | colorRGB | Color to apply to the text. |
Returns
coloredText | string | The input text wrapped in '|c' and '|r' quoted code sequences for the supplied color. |
|---|
C_ColorUtil.WrapTextInColorCode
coloredText = C_ColorUtil.WrapTextInColorCode(text, textColorCode)
Wraps a given string with color code markup.
Arguments
text | cstring | Text to be wrapped in color markup. |
|---|---|---|
textColorCode | cstring | Color to apply to the text, formatted as an 8-byte ARGB string as returned by GenerateTextColorCode. |
Returns
coloredText | string | The input text wrapped in '|c' and '|r' quoted code sequences for the supplied color. |
|---|