Skip to content

Instantly share code, notes, and snippets.

@msx752
Last active December 6, 2020 20:45
Show Gist options
  • Save msx752/3e00f03fc24b2af144a1 to your computer and use it in GitHub Desktop.
Save msx752/3e00f03fc24b2af144a1 to your computer and use it in GitHub Desktop.
hue list codes
public static uint[,] getHues(int brightnessLevel = 2) //RETURNING Z
{
uint[] allHues = HueData.GetAllHues();
if (brightnessLevel < 2)//for hue picker
brightnessLevel = 2;
else if (brightnessLevel > 6)//for hue picker
brightnessLevel = 6;
ushort[] mainColor = new ushort[] { 2, 7, 12, 17, 22, 27, 32, 37, 42, 47, 52, 57, 62, 67, 72, 77, 82, 87, 92, 97 };//X -COLOR'S TYPE
int mainColorIndex = 0;
uint[,] coloTable = new uint[20, 10];//X,Y
int mainColorTone = 0;
for (int x = 0; x < 20; x++)
{
for (int y = 0; y < 10; y++)
{
int colorIndex = (mainColor[mainColorIndex] + (brightnessLevel - 2)) + mainColorTone;//COLOR CALCULATING
coloTable[x, y] = allHues[colorIndex];//COLOR INDEX BRINGS COLOR VALUE?
mainColorTone += 100;//CONTRAST ADDING
if (mainColorTone > 950)//MAX CONTRAST
{
mainColorTone = 0;
mainColorIndex++;
}
}
if (x == mainColor.Length - 1)//COLORS'S TYPE ENDED
break;
}
return coloTable;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment