Exemplo n.º 1
0
        internal static ArgbColor[] smethod_6(DxfIndexedColor.Struct14 colorSetType)
        {
            ArgbColor[] argbColorArray = new ArgbColor[257];
            argbColorArray[0] = argbColorArray[256] = ArgbColor.Empty;
            double[][] numArray1 = new double[24][];
            double[][] numArray2 = new double[24][];
            for (int index1 = 0; index1 < 24; ++index1)
            {
                int index2 = (16 + index1) % 24;
                int index3 = (8 + index1) % 24;
                int index4 = index1 % 24;
                numArray1[index1] = new double[3]
                {
                    DxfIndexedColor.double_0[index2],
                    DxfIndexedColor.double_0[index3],
                    DxfIndexedColor.double_0[index4]
                };
                numArray2[index1] = new double[3]
                {
                    0.5 * (DxfIndexedColor.double_0[index2] + 1.0),
                    0.5 * (DxfIndexedColor.double_0[index3] + 1.0),
                    0.5 * (DxfIndexedColor.double_0[index4] + 1.0)
                };
            }
            double[] numArray3;
            switch (colorSetType.enum38_0)
            {
            case DxfIndexedColor.Enum38.const_0:
                numArray3 = new double[5]
                {
                    1.0,
                    0.8,
                    0.6,
                    0.5,
                    0.3
                };
                break;

            default:
                numArray3 = new double[5]
                {
                    1.0,
                    0.65,
                    0.5,
                    0.3,
                    0.15
                };
                break;
            }
            int num1;
            int num2;

            switch (colorSetType.enum39_0)
            {
            case DxfIndexedColor.Enum39.const_0:
                num1 = 51;
                num2 = (int)byte.MaxValue;
                break;

            case DxfIndexedColor.Enum39.const_2:
                num1 = 0;
                num2 = 229;
                break;

            default:
                num1 = 0;
                num2 = (int)byte.MaxValue;
                break;
            }
            argbColorArray[1] = ArgbColors.Red;
            argbColorArray[2] = ArgbColors.Yellow;
            argbColorArray[3] = ArgbColor.FromRgb(0, (int)byte.MaxValue, 0);
            argbColorArray[4] = ArgbColors.Cyan;
            argbColorArray[5] = ArgbColors.Blue;
            argbColorArray[6] = ArgbColors.Magenta;
            argbColorArray[7] = colorSetType.enum37_0 != DxfIndexedColor.Enum37.const_0 ? ArgbColors.Black : ArgbColors.White;
            argbColorArray[8] = ArgbColor.FromGray(128);
            argbColorArray[9] = ArgbColor.FromGray(192);
            for (int index1 = 10; index1 < 250; ++index1)
            {
                int        index2    = index1 / 10 - 1;
                double[][] numArray4 = index1 % 2 == 0 ? numArray1 : numArray2;
                int        index3    = index1 % 10 / 2;
                double[]   numArray5 = numArray4[index2];
                argbColorArray[index1] = ArgbColor.FromRgb(DxfIndexedColor.smethod_9(numArray3[index3] * numArray5[0] * (double)byte.MaxValue), DxfIndexedColor.smethod_9(numArray3[index3] * numArray5[1] * (double)byte.MaxValue), DxfIndexedColor.smethod_9(numArray3[index3] * numArray5[2] * (double)byte.MaxValue));
            }
            for (int index = 0; index < 6; ++index)
            {
                argbColorArray[250 + index] = ArgbColor.FromGray(num1 + index * (num2 - num1) / 5);
            }
            return(argbColorArray);
        }