- Main Page
- Classes
- Files

- File List
- File Members

# flColor.h File Reference

`#include "flGlobal.h"`

Go to the source code of this file.

## Defines
#define | colorRed8888(inColor) color8888_Red(inColor)
#define | colorGreen8888(inColor) color8888_Green(inColor)
#define | colorBlue8888(inColor) color8888_Blue(inColor)
#define | colorAlpha8888(inColor) color8888_Alpha(inColor)
#define | colorRGB8888(inRed, inGreen, inBlue) color8888_RGB(inRed, inGreen, inBlue)
#define | colorRGBA8888(inRed, inGreen, inBlue, inAlpha) color8888_RGBA(inRed, inGreen, inBlue, inAlpha)
#define | colorBlend8888(inColor0, inColor1, inRatio) color8888_Blend(inColor0, inColor1, inRatio)
#define | colorMerge8888(inColor0, inColor1) color8888_Merge(inColor0, inColor1)
#define | colorMergeN5650(inColor, inColorCount) colorMergeN565(inColor, inColorCount)
#define | color8888_Red(inColor) ((inColor) & 0x000000FF)
#define | color8888_Green(inColor) (((inColor) & 0x0000FF00) >> 8)
#define | color8888_Blue(inColor) (((inColor) & 0x00FF0000) >> 16)
#define | color8888_Alpha(inColor) (((inColor) & 0xFF0000) >> 24)
#define | color8888_SetAlpha(inColor, inAlpha) (((inColor) & 0x00FFFFFF) | (((inAlpha) & 0xFF) << 24))
#define | color8888_RGBA(inRed, inGreen, inBlue, inAlpha) (((inRed) + ((inGreen) << 8) + ((inBlue) << 16)) | ((inAlpha) << 24))
#define | color8888_RGB(inRed, inGreen, inBlue) (((inRed) + ((inGreen) << 8) + ((inBlue) << 16)) | (0xFF000000))
#define | color8888_Merge(inColor0, inColor1) color8888_RGBA(((color8888_Red(inColor0) + color8888_Red(inColor1)) >> 1), ((color8888_Green(inColor0) + color8888_Green(inColor1)) >> 1), ((color8888_Blue(inColor0) + color8888_Blue(inColor1)) >> 1), ((color8888_Alpha(inColor0) + color8888_Alpha(inColor1)) >> 1))
#define | color8888_Merge3(inColor0, inColor1, inColor2) color8888_RGBA(((color8888_Red(inColor0) + color8888_Red(inColor1) + color8888_Red(inColor2)) / 3), ((color8888_Green(inColor0) + color8888_Green(inColor1) + color8888_Green(inColor2)) / 3), ((color8888_Blue(inColor0) + color8888_Blue(inColor1) + color8888_Blue(inColor2)) / 3), ((color8888_Alpha(inColor0) + color8888_Alpha(inColor1) + color8888_Alpha(inColor2)) / 3))
#define | color8888_Merge4(inColor0, inColor1, inColor2, inColor3) color8888_RGBA(((color8888_Red(inColor0) + color8888_Red(inColor1) + color8888_Red(inColor2) + color8888_Red(inColor3)) >> 2), ((color8888_Green(inColor0) + color8888_Green(inColor1) + color8888_Green(inColor2) + color8888_Green(inColor3)) >> 2), ((color8888_Blue(inColor0) + color8888_Blue(inColor1) + color8888_Blue(inColor2) + color8888_Blue(inColor3)) >> 2), ((color8888_Alpha(inColor0) + color8888_Alpha(inColor1) + color8888_Alpha(inColor2) + color8888_Alpha(inColor3)) >> 2))
#define | color8888_Blend(inColor0, inColor1, inFract) color8888_RGBA((int)(((float)color8888_Red(inColor0) * (float)(inFract)) + ((float)color8888_Red(inColor1) * (1.0f - (float)(inFract)))), (int)(((float)color8888_Green(inColor0) * (float)(inFract)) + ((float)color8888_Green(inColor1) * (1.0f - (float)(inFract)))), (int)(((float)color8888_Blue(inColor0) * (float)(inFract)) + ((float)color8888_Blue(inColor1) * (1.0f - (float)(inFract)))), (int)(((float)color8888_Alpha(inColor0) * (float)(inFract)) + ((float)color8888_Alpha(inColor1) * (1.0f - (float)(inFract)))))
#define | color8888_CMYK(inCyan, inMagenta, inYellow, inKey) color8888_Merge3(color8888_Blend(0xFFFFFF00, colorRGB((inKey), (inKey), (inKey)), ((float)(inCyan) / 255.0f)), color8888_Blend(0xFFFF00FF, colorRGB((inKey), (inKey), (inKey)), ((float)(inMagenta) / 255.0f)), color8888_Blend(0xFF00FFFF, colorRGB((inKey), (inKey), (inKey)), ((float)(inYellow) / 255.0f)))
#define | color8888_CMYKA(inCyan, inMagenta, inYellow, inKey, inAlpha) color8888_SetAlpha(color8888_CMYK(inCyan, inMagenta, inYellow, inKey), inAlpha)
#define | color8888_CMY(inCyan, inMagenta, inYellow) color8888_RGB((255 - (inCyan)), (255 - (inMagenta)), (255 - (inYellow)))
#define | color8888_CMYA(inCyan, inMagenta, inYellow, inAlpha) color8888_SetAlpha(color8888_CMY(inCyan, inMagenta, inYellow), inAlpha)
#define | color8888_Cmp(inColor0, inColor1) (pos((int)color8888_Red(inColor0) - (int)color8888_Red(inColor1)) + pos((int)color8888_Green(inColor0) - (int)color8888_Green(inColor1)) + pos((int)color8888_Blue(inColor0) - (int)color8888_Blue(inColor1)) + pos((int)color8888_Alpha(inColor0) - (int)color8888_Alpha(inColor1)))
#define | color8888_Compare(inColor0, inColor1) color8888_Cmp(inColor0, inColor1)
#define | color4444_Red(inColor) ((inColor) & 0x000F)
#define | color4444_Green(inColor) (((inColor) & 0x00F0) >> 4)
#define | color4444_Blue(inColor) (((inColor) & 0x0F00) >> 8)
#define | color4444_Alpha(inColor) (((inColor) & 0xF000) >> 12)
#define | color4444_RGBA(inRed, inGreen, inBlue, inAlpha) (((inRed) & 0x000F) + (((inGreen) & 0x000F) << 4) + (((inBlue) & 0x000F) << 8) + (((inAlpha) & 0x000F) << 12))
#define | color4444_RGB(inRed, inGreen, inBlue) color4444_RGBA(inRed, inGreen, inBlue, 15);
#define | color4444_Merge(inColor0, inColor1) color4444_RGBA(((color4444_Red(inColor0) + color4444_Red(inColor1)) >> 1), ((color4444_Green(inColor0) + color4444_Green(inColor1)) >> 1), ((color4444_Blue(inColor0) + color4444_Blue(inColor1)) >> 1), ((color4444_Alpha(inColor0) + color4444_Alpha(inColor1)) >> 1))
#define | color4444_Merge4(inColor0, inColor1, inColor2, inColor3) color4444_RGBA(((color4444_Red(inColor0) + color4444_Red(inColor1) + color4444_Red(inColor2) + color4444_Red(inColor3)) >> 2), ((color4444_Green(inColor0) + color4444_Green(inColor1) + color4444_Green(inColor2) + color4444_Green(inColor3)) >> 2), ((color4444_Blue(inColor0) + color4444_Blue(inColor1) + color4444_Blue(inColor2) + color4444_Blue(inColor3)) >> 2), ((color4444_Alpha(inColor0) + color4444_Alpha(inColor1) + color4444_Alpha(inColor2) + color4444_Alpha(inColor3)) >> 2))
#define | color4444_Cmp(inColor0, inColor1) (pos((int)color4444_Red(inColor0) - (int)color4444_Red(inColor1)) + pos((int)color4444_Green(inColor0) - (int)color4444_Green(inColor1)) + pos((int)color4444_Blue(inColor0) - (int)color4444_Blue(inColor1)) + pos((int)color4444_Alpha(inColor0) - (int)color4444_Alpha(inColor1)))
#define | color4444_Compare(inColor0, inColor1) color4444_Cmp(inColor0, inColor1)
#define | color5551_Red(inColor) ((inColor) & 0x001F)
#define | color5551_Green(inColor) (((inColor) & 0x03E0) >> 5)
#define | color5551_Blue(inColor) (((inColor) & 0x7C00) >> 10)
#define | color5551_Alpha(inColor) (((inColor) & 0x8000) >> 15)
#define | color5551_RGBA(inRed, inGreen, inBlue, inAlpha) (((inRed) & 0x001F) + (((inGreen) & 0x001F) << 5) + (((inBlue) & 0x001F) << 10) + (((inAlpha) & 0x0001) << 15))
#define | color5551_RGB(inRed, inGreen, inBlue) color5551_RGBA(inRed, inGreen, inBlue, 1);
#define | color5551_Merge(inColor0, inColor1) color5551_RGBA(((color5551_Red(inColor0) + color5551_Red(inColor1)) >> 1), ((color5551_Green(inColor0) + color5551_Green(inColor1)) >> 1), ((color5551_Blue(inColor0) + color5551_Blue(inColor1)) >> 1), ((color5551_Alpha(inColor0) + color5551_Alpha(inColor1)) >> 1))
#define | color5551_Merge4(inColor0, inColor1, inColor2, inColor3) color5551_RGBA(((color5551_Red(inColor0) + color5551_Red(inColor1) + color5551_Red(inColor2) + color5551_Red(inColor3)) >> 2), ((color5551_Green(inColor0) + color5551_Green(inColor1) + color5551_Green(inColor2) + color5551_Green(inColor3)) >> 2), ((color5551_Blue(inColor0) + color5551_Blue(inColor1) + color5551_Blue(inColor2) + color5551_Blue(inColor3)) >> 2), ((color5551_Alpha(inColor0) + color5551_Alpha(inColor1) + color5551_Alpha(inColor2) + color5551_Alpha(inColor3)) >> 2))
#define | color5551_Cmp(inColor0, inColor1) (pos((int)color5551_Red(inColor0) - (int)color5551_Red(inColor1)) + pos((int)color5551_Green(inColor0) - (int)color5551_Green(inColor1)) + pos((int)color5551_Blue(inColor0) - (int)color5551_Blue(inColor1)) + pos((int)color5551_Alpha(inColor0) - (int)color5551_Alpha(inColor1)))
#define | color5551_Compare(inColor0, inColor1) color5551_Cmp(inColor0, inColor1)
#define | color565_Red(inColor) ((inColor) & 0x001F)
#define | color565_Green(inColor) (((inColor) & 0x07E0) >> 5)
#define | color565_Blue(inColor) (((inColor) & 0xF800) >> 11)
#define | color565_RGB(inRed, inGreen, inBlue) (((inRed) & 0x001F) + (((inGreen) & 0x003F) << 5) + (((inBlue) & 0x001F) << 11))
#define | color565_Merge(inColor0, inColor1) color565_RGB(((color565_Red(inColor0) + color565_Red(inColor1)) >> 1), ((color565_Green(inColor0) + color565_Green(inColor1)) >> 1), ((color565_Blue(inColor0) + color565_Blue(inColor1)) >> 1))
#define | color565_Merge4(inColor0, inColor1, inColor2, inColor3) color565_RGB(((color565_Red(inColor0) + color565_Red(inColor1) + color565_Red(inColor2) + color565_Red(inColor3)) >> 2), ((color565_Green(inColor0) + color565_Green(inColor1) + color565_Green(inColor2) + color565_Green(inColor3)) >> 2), ((color565_Blue(inColor0) + color565_Blue(inColor1) + color565_Blue(inColor2) + color565_Blue(inColor3)) >> 2))
#define | color565_Cmp(inColor0, inColor1) (pos((int)color565_Red(inColor0) - (int)color565_Red(inColor1)) + pos((int)color565_Green(inColor0) - (int)color565_Green(inColor1)) + pos((int)color565_Blue(inColor0) - (int)color565_Blue(inColor1)))
#define | color565_Compare(inColor0, inColor1) color565_Cmp(inColor0, inColor1)
#define | color5650_Red(inColor) color565_Red(inColor)
#define | color5650_Green(inColor) color565_Green(inColor)
#define | color5650_Blue(inColor) color565_Blue(inColor)
#define | color5650_RGB(inRed, inGreen, inBlue) color565_RGB(inRed, inGreen, inBlue)
#define | color5650_Merge(inColor0, inColor1) color565_Merge(inColor0, inColor1)
#define | color5650_Merge4(inColor0, inColor1, inColor2, inColor3) color565_Merge4(inColor0, inColor1, inColor2, inColor3)
#define | color5650_Cmp(inColor0, inColor1) color565_Cmp(inColor0, inColor1)
#define | color5650_Compare(inColor0, inColor1) color565_Compare(inColor0, inColor1)
## Functions
u32 | colorHSL (u8 inHue, u8 inSat, u8 inLum)
u8 | colorHue8888 (u32 inColor)
u8 | colorLum8888 (u32 inColor)
u8 | colorSat8888 (u32 inColor)
u32 | colorMergeN8888 (u32 *inColor, u32 inColorCount)
u16 | colorMergeN4444 (u16 *inColor, u16 inColorCount)
u16 | colorMergeN5551 (u16 *inColor, u16 inColorCount)
u16 | colorMergeN565 (u16 *inColor, u16 inColorCount)
u32 | colorRandom8888 (u8 inBaseLum, u8 inRandLum, u8 inAlpha)
u32 | colorLumMult8888 (u32 inColor, float inLum)
u32 | colorAlphaMult8888 (u32 inColor, float inMult)

## Define Documentation

#define color4444_Alpha | ( | inColor |  | ) | (((inColor) & 0xF000) >> 12)

Definition at line 91 of file flColor.h.

Referenced by colorMergeN4444().

#define color4444_Blue | ( | inColor |  | ) | (((inColor) & 0x0F00) >> 8)

Definition at line 90 of file flColor.h.

Referenced by colorMergeN4444().

#define color4444_Cmp | ( | inColor0,
|  | inColor1 |  | ) | (pos((int)color4444_Red(inColor0) - (int)color4444_Red(inColor1)) + pos((int)color4444_Green(inColor0) - (int)color4444_Green(inColor1)) + pos((int)color4444_Blue(inColor0) - (int)color4444_Blue(inColor1)) + pos((int)color4444_Alpha(inColor0) - (int)color4444_Alpha(inColor1)))

Definition at line 96 of file flColor.h.

Referenced by palClosestColor().

#define color4444_Compare | ( | inColor0,
|  | inColor1 |  | ) | color4444_Cmp(inColor0, inColor1)

Definition at line 97 of file flColor.h.

#define color4444_Green | ( | inColor |  | ) | (((inColor) & 0x00F0) >> 4)

Definition at line 89 of file flColor.h.

Referenced by colorMergeN4444().

#define color4444_Merge | ( | inColor0,
|  | inColor1 |  | ) | color4444_RGBA(((color4444_Red(inColor0) + color4444_Red(inColor1)) >> 1), ((color4444_Green(inColor0) + color4444_Green(inColor1)) >> 1), ((color4444_Blue(inColor0) + color4444_Blue(inColor1)) >> 1), ((color4444_Alpha(inColor0) + color4444_Alpha(inColor1)) >> 1))

Definition at line 94 of file flColor.h.

#define color4444_Merge4 | ( | inColor0,
|  | inColor1,
|  | inColor2,
|  | inColor3 |  | ) | color4444_RGBA(((color4444_Red(inColor0) + color4444_Red(inColor1) + color4444_Red(inColor2) + color4444_Red(inColor3)) >> 2), ((color4444_Green(inColor0) + color4444_Green(inColor1) + color4444_Green(inColor2) + color4444_Green(inColor3)) >> 2), ((color4444_Blue(inColor0) + color4444_Blue(inColor1) + color4444_Blue(inColor2) + color4444_Blue(inColor3)) >> 2), ((color4444_Alpha(inColor0) + color4444_Alpha(inColor1) + color4444_Alpha(inColor2) + color4444_Alpha(inColor3)) >> 2))

Definition at line 95 of file flColor.h.

#define color4444_Red | ( | inColor |  | ) | ((inColor) & 0x000F)

Definition at line 88 of file flColor.h.

Referenced by colorMergeN4444().

#define color4444_RGB | ( | inRed,
|  | inGreen,
|  | inBlue |  | ) | color4444_RGBA(inRed, inGreen, inBlue, 15);

Definition at line 93 of file flColor.h.

#define color4444_RGBA | ( | inRed,
|  | inGreen,
|  | inBlue,
|  | inAlpha |  | ) | (((inRed) & 0x000F) + (((inGreen) & 0x000F) << 4) + (((inBlue) & 0x000F) << 8) + (((inAlpha) & 0x000F) << 12))

Definition at line 92 of file flColor.h.

Referenced by colorMergeN4444().

#define color5551_Alpha | ( | inColor |  | ) | (((inColor) & 0x8000) >> 15)

Definition at line 102 of file flColor.h.

Referenced by colorMergeN5551().

#define color5551_Blue | ( | inColor |  | ) | (((inColor) & 0x7C00) >> 10)

Definition at line 101 of file flColor.h.

Referenced by colorMergeN5551().

#define color5551_Cmp | ( | inColor0,
|  | inColor1 |  | ) | (pos((int)color5551_Red(inColor0) - (int)color5551_Red(inColor1)) + pos((int)color5551_Green(inColor0) - (int)color5551_Green(inColor1)) + pos((int)color5551_Blue(inColor0) - (int)color5551_Blue(inColor1)) + pos((int)color5551_Alpha(inColor0) - (int)color5551_Alpha(inColor1)))

Definition at line 107 of file flColor.h.

Referenced by palClosestColor().

#define color5551_Compare | ( | inColor0,
|  | inColor1 |  | ) | color5551_Cmp(inColor0, inColor1)

Definition at line 108 of file flColor.h.

#define color5551_Green | ( | inColor |  | ) | (((inColor) & 0x03E0) >> 5)

Definition at line 100 of file flColor.h.

Referenced by colorMergeN5551().

#define color5551_Merge | ( | inColor0,
|  | inColor1 |  | ) | color5551_RGBA(((color5551_Red(inColor0) + color5551_Red(inColor1)) >> 1), ((color5551_Green(inColor0) + color5551_Green(inColor1)) >> 1), ((color5551_Blue(inColor0) + color5551_Blue(inColor1)) >> 1), ((color5551_Alpha(inColor0) + color5551_Alpha(inColor1)) >> 1))

Definition at line 105 of file flColor.h.

#define color5551_Merge4 | ( | inColor0,
|  | inColor1,
|  | inColor2,
|  | inColor3 |  | ) | color5551_RGBA(((color5551_Red(inColor0) + color5551_Red(inColor1) + color5551_Red(inColor2) + color5551_Red(inColor3)) >> 2), ((color5551_Green(inColor0) + color5551_Green(inColor1) + color5551_Green(inColor2) + color5551_Green(inColor3)) >> 2), ((color5551_Blue(inColor0) + color5551_Blue(inColor1) + color5551_Blue(inColor2) + color5551_Blue(inColor3)) >> 2), ((color5551_Alpha(inColor0) + color5551_Alpha(inColor1) + color5551_Alpha(inColor2) + color5551_Alpha(inColor3)) >> 2))

Definition at line 106 of file flColor.h.

#define color5551_Red | ( | inColor |  | ) | ((inColor) & 0x001F)

Definition at line 99 of file flColor.h.

Referenced by colorMergeN5551().

#define color5551_RGB | ( | inRed,
|  | inGreen,
|  | inBlue |  | ) | color5551_RGBA(inRed, inGreen, inBlue, 1);

Definition at line 104 of file flColor.h.

#define color5551_RGBA | ( | inRed,
|  | inGreen,
|  | inBlue,
|  | inAlpha |  | ) | (((inRed) & 0x001F) + (((inGreen) & 0x001F) << 5) + (((inBlue) & 0x001F) << 10) + (((inAlpha) & 0x0001) << 15))

Definition at line 103 of file flColor.h.

Referenced by colorMergeN5551().

#define color5650_Blue | ( | inColor |  | ) | color565_Blue(inColor)

Definition at line 121 of file flColor.h.

#define color5650_Cmp | ( | inColor0,
|  | inColor1 |  | ) | color565_Cmp(inColor0, inColor1)

Definition at line 125 of file flColor.h.

Referenced by palClosestColor().

#define color5650_Compare | ( | inColor0,
|  | inColor1 |  | ) | color565_Compare(inColor0, inColor1)

Definition at line 126 of file flColor.h.

#define color5650_Green | ( | inColor |  | ) | color565_Green(inColor)

Definition at line 120 of file flColor.h.

#define color5650_Merge | ( | inColor0,
|  | inColor1 |  | ) | color565_Merge(inColor0, inColor1)

Definition at line 123 of file flColor.h.

#define color5650_Merge4 | ( | inColor0,
|  | inColor1,
|  | inColor2,
|  | inColor3 |  | ) | color565_Merge4(inColor0, inColor1, inColor2, inColor3)

Definition at line 124 of file flColor.h.

#define color5650_Red | ( | inColor |  | ) | color565_Red(inColor)

Definition at line 119 of file flColor.h.

#define color5650_RGB | ( | inRed,
|  | inGreen,
|  | inBlue |  | ) | color565_RGB(inRed, inGreen, inBlue)

Definition at line 122 of file flColor.h.

#define color565_Blue | ( | inColor |  | ) | (((inColor) & 0xF800) >> 11)

Definition at line 112 of file flColor.h.

Referenced by colorMergeN565().

#define color565_Cmp | ( | inColor0,
|  | inColor1 |  | ) | (pos((int)color565_Red(inColor0) - (int)color565_Red(inColor1)) + pos((int)color565_Green(inColor0) - (int)color565_Green(inColor1)) + pos((int)color565_Blue(inColor0) - (int)color565_Blue(inColor1)))

Definition at line 116 of file flColor.h.

#define color565_Compare | ( | inColor0,
|  | inColor1 |  | ) | color565_Cmp(inColor0, inColor1)

Definition at line 117 of file flColor.h.

#define color565_Green | ( | inColor |  | ) | (((inColor) & 0x07E0) >> 5)

Definition at line 111 of file flColor.h.

Referenced by colorMergeN565().

#define color565_Merge | ( | inColor0,
|  | inColor1 |  | ) | color565_RGB(((color565_Red(inColor0) + color565_Red(inColor1)) >> 1), ((color565_Green(inColor0) + color565_Green(inColor1)) >> 1), ((color565_Blue(inColor0) + color565_Blue(inColor1)) >> 1))

Definition at line 114 of file flColor.h.

#define color565_Merge4 | ( | inColor0,
|  | inColor1,
|  | inColor2,
|  | inColor3 |  | ) | color565_RGB(((color565_Red(inColor0) + color565_Red(inColor1) + color565_Red(inColor2) + color565_Red(inColor3)) >> 2), ((color565_Green(inColor0) + color565_Green(inColor1) + color565_Green(inColor2) + color565_Green(inColor3)) >> 2), ((color565_Blue(inColor0) + color565_Blue(inColor1) + color565_Blue(inColor2) + color565_Blue(inColor3)) >> 2))

Definition at line 115 of file flColor.h.

#define color565_Red | ( | inColor |  | ) | ((inColor) & 0x001F)

Definition at line 110 of file flColor.h.

Referenced by colorMergeN565().

#define color565_RGB | ( | inRed,
|  | inGreen,
|  | inBlue |  | ) | (((inRed) & 0x001F) + (((inGreen) & 0x003F) << 5) + (((inBlue) & 0x001F) << 11))

Definition at line 113 of file flColor.h.

Referenced by colorMergeN565().

#define color8888_Alpha | ( | inColor |  | ) | (((inColor) & 0xFF0000) >> 24)

Definition at line 73 of file flColor.h.

Referenced by colorAlphaMult8888(), graphicsEffectFsGrayscaleSW(), and graphicsEffectFsNightVisionSW().

#define color8888_Blend | ( | inColor0,
|  | inColor1,
|  | inFract |  | ) | color8888_RGBA((int)(((float)color8888_Red(inColor0) * (float)(inFract)) + ((float)color8888_Red(inColor1) * (1.0f - (float)(inFract)))), (int)(((float)color8888_Green(inColor0) * (float)(inFract)) + ((float)color8888_Green(inColor1) * (1.0f - (float)(inFract)))), (int)(((float)color8888_Blue(inColor0) * (float)(inFract)) + ((float)color8888_Blue(inColor1) * (1.0f - (float)(inFract)))), (int)(((float)color8888_Alpha(inColor0) * (float)(inFract)) + ((float)color8888_Alpha(inColor1) * (1.0f - (float)(inFract)))))

Definition at line 80 of file flColor.h.

#define color8888_Blue | ( | inColor |  | ) | (((inColor) & 0x00FF0000) >> 16)

Definition at line 72 of file flColor.h.

Referenced by colorHue8888(), colorLum8888(), colorLumMult8888(), colorSat8888(), graphicsEffectFsDepthFog(), graphicsEffectFsGrayscaleSW(), and graphicsEffectFsNightVisionSW().

#define color8888_Cmp | ( | inColor0,
|  | inColor1 |  | ) | (pos((int)color8888_Red(inColor0) - (int)color8888_Red(inColor1)) + pos((int)color8888_Green(inColor0) - (int)color8888_Green(inColor1)) + pos((int)color8888_Blue(inColor0) - (int)color8888_Blue(inColor1)) + pos((int)color8888_Alpha(inColor0) - (int)color8888_Alpha(inColor1)))

Definition at line 85 of file flColor.h.

Referenced by palClosestColor().

#define color8888_CMY | ( | inCyan,
|  | inMagenta,
|  | inYellow |  | ) | color8888_RGB((255 - (inCyan)), (255 - (inMagenta)), (255 - (inYellow)))

Definition at line 83 of file flColor.h.

#define color8888_CMYA | ( | inCyan,
|  | inMagenta,
|  | inYellow,
|  | inAlpha |  | ) | color8888_SetAlpha(color8888_CMY(inCyan, inMagenta, inYellow), inAlpha)

Definition at line 84 of file flColor.h.

#define color8888_CMYK | ( | inCyan,
|  | inMagenta,
|  | inYellow,
|  | inKey |  | ) | color8888_Merge3(color8888_Blend(0xFFFFFF00, colorRGB((inKey), (inKey), (inKey)), ((float)(inCyan) / 255.0f)), color8888_Blend(0xFFFF00FF, colorRGB((inKey), (inKey), (inKey)), ((float)(inMagenta) / 255.0f)), color8888_Blend(0xFF00FFFF, colorRGB((inKey), (inKey), (inKey)), ((float)(inYellow) / 255.0f)))

Definition at line 81 of file flColor.h.

#define color8888_CMYKA | ( | inCyan,
|  | inMagenta,
|  | inYellow,
|  | inKey,
|  | inAlpha |  | ) | color8888_SetAlpha(color8888_CMYK(inCyan, inMagenta, inYellow, inKey), inAlpha)

Definition at line 82 of file flColor.h.

#define color8888_Compare | ( | inColor0,
|  | inColor1 |  | ) | color8888_Cmp(inColor0, inColor1)

Definition at line 86 of file flColor.h.

#define color8888_Green | ( | inColor |  | ) | (((inColor) & 0x0000FF00) >> 8)

Definition at line 71 of file flColor.h.

Referenced by colorHue8888(), colorLum8888(), colorLumMult8888(), colorSat8888(), graphicsEffectFsDepthFog(), graphicsEffectFsGrayscaleSW(), and graphicsEffectFsNightVisionSW().

#define color8888_Merge | ( | inColor0,
|  | inColor1 |  | ) | color8888_RGBA(((color8888_Red(inColor0) + color8888_Red(inColor1)) >> 1), ((color8888_Green(inColor0) + color8888_Green(inColor1)) >> 1), ((color8888_Blue(inColor0) + color8888_Blue(inColor1)) >> 1), ((color8888_Alpha(inColor0) + color8888_Alpha(inColor1)) >> 1))

Definition at line 77 of file flColor.h.

#define color8888_Merge3 | ( | inColor0,
|  | inColor1,
|  | inColor2 |  | ) | color8888_RGBA(((color8888_Red(inColor0) + color8888_Red(inColor1) + color8888_Red(inColor2)) / 3), ((color8888_Green(inColor0) + color8888_Green(inColor1) + color8888_Green(inColor2)) / 3), ((color8888_Blue(inColor0) + color8888_Blue(inColor1) + color8888_Blue(inColor2)) / 3), ((color8888_Alpha(inColor0) + color8888_Alpha(inColor1) + color8888_Alpha(inColor2)) / 3))

Definition at line 78 of file flColor.h.

#define color8888_Merge4 | ( | inColor0,
|  | inColor1,
|  | inColor2,
|  | inColor3 |  | ) | color8888_RGBA(((color8888_Red(inColor0) + color8888_Red(inColor1) + color8888_Red(inColor2) + color8888_Red(inColor3)) >> 2), ((color8888_Green(inColor0) + color8888_Green(inColor1) + color8888_Green(inColor2) + color8888_Green(inColor3)) >> 2), ((color8888_Blue(inColor0) + color8888_Blue(inColor1) + color8888_Blue(inColor2) + color8888_Blue(inColor3)) >> 2), ((color8888_Alpha(inColor0) + color8888_Alpha(inColor1) + color8888_Alpha(inColor2) + color8888_Alpha(inColor3)) >> 2))

Definition at line 79 of file flColor.h.

#define color8888_Red | ( | inColor |  | ) | ((inColor) & 0x000000FF)

Definition at line 70 of file flColor.h.

Referenced by colorHue8888(), colorLum8888(), colorLumMult8888(), colorSat8888(), graphicsEffectFsDepthFog(), graphicsEffectFsGrayscaleSW(), and graphicsEffectFsNightVisionSW().

#define color8888_RGB | ( | inRed,
|  | inGreen,
|  | inBlue |  | ) | (((inRed) + ((inGreen) << 8) + ((inBlue) << 16)) | (0xFF000000))

Definition at line 76 of file flColor.h.

Referenced by colorHSL().

#define color8888_RGBA | ( | inRed,
|  | inGreen,
|  | inBlue,
|  | inAlpha |  | ) | (((inRed) + ((inGreen) << 8) + ((inBlue) << 16)) | ((inAlpha) << 24))

Definition at line 75 of file flColor.h.

Referenced by colorMergeN8888(), graphicsEffectFsGrayscaleSW(), and graphicsEffectFsNightVisionSW().

#define color8888_SetAlpha | ( | inColor,
|  | inAlpha |  | ) | (((inColor) & 0x00FFFFFF) | (((inAlpha) & 0xFF) << 24))

Definition at line 74 of file flColor.h.

#define colorAlpha8888 | ( | inColor |  | ) | color8888_Alpha(inColor)

Definition at line 32 of file flColor.h.

#define colorBlend8888 | ( | inColor0,
|  | inColor1,
|  | inRatio |  | ) | color8888_Blend(inColor0, inColor1, inRatio)

Definition at line 42 of file flColor.h.

#define colorBlue8888 | ( | inColor |  | ) | color8888_Blue(inColor)

Definition at line 31 of file flColor.h.

#define colorGreen8888 | ( | inColor |  | ) | color8888_Green(inColor)

Definition at line 30 of file flColor.h.

#define colorMerge8888 | ( | inColor0,
|  | inColor1 |  | ) | color8888_Merge(inColor0, inColor1)

Definition at line 43 of file flColor.h.

#define colorMergeN5650 | ( | inColor,
|  | inColorCount |  | ) | colorMergeN565(inColor, inColorCount)

Definition at line 48 of file flColor.h.

#define colorRed8888 | ( | inColor |  | ) | color8888_Red(inColor)

Definition at line 29 of file flColor.h.

#define colorRGB8888 | ( | inRed,
|  | inGreen,
|  | inBlue |  | ) | color8888_RGB(inRed, inGreen, inBlue)

Definition at line 33 of file flColor.h.

#define colorRGBA8888 | ( | inRed,
|  | inGreen,
|  | inBlue,
|  | inAlpha |  | ) | color8888_RGBA(inRed, inGreen, inBlue, inAlpha)

Definition at line 34 of file flColor.h.

## Function Documentation

u32 colorAlphaMult8888 | ( | u32 | inColor,
|  | float | inMult |
| ) |  |  |

Definition at line 194 of file flColor.c.

References color8888_Alpha, and min.

u32 colorHSL | ( | u8 | inHue,
|  | u8 | inSat,
|  | u8 | inLum |
| ) |  |  |

Definition at line 11 of file flColor.c.

References color8888_RGB.

u8 colorHue8888 | ( | u32 | inColor | ) |

Definition at line 43 of file flColor.c.

References color8888_Blue, color8888_Green, color8888_Red, max, and min.

u8 colorLum8888 | ( | u32 | inColor | ) |

Definition at line 89 of file flColor.c.

References color8888_Blue, color8888_Green, color8888_Red, max, and min.

u32 colorLumMult8888 | ( | u32 | inColor,
|  | float | inLum |
| ) |  |  |

Definition at line 185 of file flColor.c.

References color8888_Blue, color8888_Green, color8888_Red, min, and pos.

Referenced by graphics2dDrawSpheroidShaded().

u16 colorMergeN4444 | ( | u16 * | inColor,
|  | u16 | inColorCount |
| ) |  |  |

Definition at line 122 of file flColor.c.

References color4444_Alpha, color4444_Blue, color4444_Green, color4444_Red, and color4444_RGBA.

u16 colorMergeN5551 | ( | u16 * | inColor,
|  | u16 | inColorCount |
| ) |  |  |

Definition at line 139 of file flColor.c.

References color5551_Alpha, color5551_Blue, color5551_Green, color5551_Red, and color5551_RGBA.

u16 colorMergeN565 | ( | u16 * | inColor,
|  | u16 | inColorCount |
| ) |  |  |

Definition at line 156 of file flColor.c.

References color565_Blue, color565_Green, color565_Red, and color565_RGB.

u32 colorMergeN8888 | ( | u32 * | inColor,
|  | u32 | inColorCount |
| ) |  |  |

Definition at line 104 of file flColor.c.

References color8888_RGBA.

u32 colorRandom8888 | ( | u8 | inBaseLum,
|  | u8 | inRandLum,
|  | u8 | inAlpha |
| ) |  |  |

Definition at line 171 of file flColor.c.

References mathRandi().

u8 colorSat8888 | ( | u32 | inColor | ) |

Definition at line 72 of file flColor.c.

References color8888_Blue, color8888_Green, and color8888_Red.