private unsafe Bitmap CalculateColorPickerBitmap(float hue) { Bitmap bitmap = new Bitmap(120, 120); Color color = Color.FromKnownColor(KnownColor.Control); float num = hue * -0.0174532924f; double num2 = (double)num; float num3 = (float)Math.Cos(num2); GLine gLine = (float)Math.Sin(num2); double num4 = (double)(num + 2.09439516f); float num5 = (float)Math.Cos(num4); float num6 = num5; float num7 = (float)Math.Sin(num4); GLine gLine2 = num7; double num8 = (double)(num - 2.09439516f); float num9 = (float)Math.Cos(num8); GLine gLine3 = (float)Math.Sin(num8); int num10 = 0; do { float num11 = (float)(num10 - 60); float num12 = num11 + 0.5f; int num13 = -60; do { float num14 = num12; float num15 = (float)num13; float num16 = num15 + 0.5f; float num17 = num16; float expr_AC = num17; float arg_B2_0 = expr_AC * expr_AC; float expr_B0 = num14; float num18 = arg_B2_0 + expr_B0 * expr_B0; if (num18 > 3685.353f) { bitmap.SetPixel(num13 + 60, num10, color); } else if (num18 < 2236.61768f) { int num19 = 0; int num20 = 0; float num21 = num15 + 0.125f; float num22 = num15 + 0.375f; float num23 = num15 + 0.625f; float num24 = num15 + 0.875f; do { GPoint2 gPoint = num21; float num25 = ((float)num20 + 0.5f) * 0.25f + num11; *(ref gPoint + 4) = num25; if (*(ref gPoint + 4) * num3 + gPoint * gLine - 22.5f < 0f && gPoint * gLine2 + *(ref gPoint + 4) * num6 - 22.5f < 0f && gPoint * gLine3 + *(ref gPoint + 4) * num9 - 22.5f < 0f) { num19++; } gPoint = num22; *(ref gPoint + 4) = num25; if (*(ref gPoint + 4) * num3 + gPoint * gLine - 22.5f < 0f && gPoint * gLine2 + *(ref gPoint + 4) * num6 - 22.5f < 0f && gPoint * gLine3 + *(ref gPoint + 4) * num9 - 22.5f < 0f) { num19++; } gPoint = num23; *(ref gPoint + 4) = num25; if (*(ref gPoint + 4) * num3 + gPoint * gLine - 22.5f < 0f && gPoint * gLine2 + *(ref gPoint + 4) * num6 - 22.5f < 0f && gPoint * gLine3 + *(ref gPoint + 4) * num9 - 22.5f < 0f) { num19++; } gPoint = num24; *(ref gPoint + 4) = num25; if (*(ref gPoint + 4) * num3 + gPoint * gLine - 22.5f < 0f && gPoint * gLine2 + *(ref gPoint + 4) * num6 - 22.5f < 0f && gPoint * gLine3 + *(ref gPoint + 4) * num9 - 22.5f < 0f) { num19++; } num20++; }while (num20 < 4); if (num19 != 0) { GPoint2 gPoint2 = num16; *(ref gPoint2 + 4) = num12; float num26 = num5; float num27 = num7; float num28 = (num27 * gPoint2 + num26 * *(ref gPoint2 + 4) + 45f) * 0.0148148146f; float num29; if (num28 <= 0f) { num29 = 0f; goto IL_32A; } num29 = num28; if (num28 < 1f) { goto IL_32A; } float num30 = 1f; IL_337: double num31 = (double)(num + 3.66519165f); float num32 = (float)Math.Cos(num31); float num33 = (float)Math.Sin(num31); float num34 = num33 * gPoint2 + num32 * *(ref gPoint2 + 4); if (num30 <= 0.001f) { goto IL_3A2; } num34 = num34 / num30 * 0.0222222228f / (float)Math.Sqrt(3.0) + 0.5f; if (num34 <= 0f) { goto IL_3A2; } float num35 = num34; if (num34 < 1f) { goto IL_3B4; } float num36 = 1f; IL_3C1: GColor gColor; *(ref gColor + 8) = 0f; *(ref gColor + 4) = 0f; gColor = 0f; *(ref gColor + 12) = 1f; < Module >.GColor.FromHSV(ref gColor, (int)((double)hue), (int)((double)(num36 * 100f)), (int)((double)(num30 * 100f))); if (num19 == 16) { Color color2 = Color.FromArgb(255, (int)(gColor * 255f), (int)((double)(*(ref gColor + 4) * 255f)), (int)((double)(*(ref gColor + 8) * 255f))); bitmap.SetPixel(num13 + 60, num10, color2); goto IL_8D1; } float num37 = (float)num19 * 0.0625f; float num38 = 1f - num37; Color color3 = Color.FromArgb(255, (int)((float)color.R * num38 + num37 * gColor * 255f), (int)((double)((float)color.G * num38 + num37 * *(ref gColor + 4) * 255f)), (int)((double)((float)color.B * num38 + num37 * *(ref gColor + 8) * 255f))); bitmap.SetPixel(num13 + 60, num10, color3); goto IL_8D1; IL_3B4: num36 = num35; goto IL_3C1; IL_3A2: num35 = 0f; goto IL_3B4; IL_32A: num30 = num29; goto IL_337; } bitmap.SetPixel(num13 + 60, num10, color); }