none
ungültiger Ausdruck int RRS feed

  • Frage

  • Ich möchte aus ein Array eine bestimmte Farbe darstellen, leider komme ich hier nicht weiter.

    Hier ist mal mein Code

            public static Color GetFarbwert(double EBC)
            {
                // Tabelle mit Farbwertzuordnung srm -> RGB
                int [,] Farbe = {
                {250,250,210},
                {250,250,204},
                {250,250,199},
                {250,250,193},
                {250,250,188},
                {250,250,182},
                {250,250,177},
                {250,250,171},
                {250,250,166},
                {250,250,160},
                {250,250,155},
                {250,250,149},
                {250,250,144},
                {250,250,138},
                {250,250,133},
                {250,250,127},
                {250,250,122},
                {250,250,116},
                {250,250,111},
                {250,250,105},
                {250,250,100},
                {250,250,94},
                {250,250,89},
                {250,250,83},
                {250,250,78},
                {249,250,72},
                {248,249,67},
                {247,248,61},
                {246,247,56},
                {245,246,50},
                {244,245,45},
                {243,244,45},
                {242,242,45},
                {241,240,46},
                {240,238,46},
                {239,236,46},
                {238,234,46},
                {237,232,47},
                {236,230,47},
                {235,228,47},
                {234,226,47},
                {233,224,48},
                {232,222,48},
                {231,220,48},
                {230,218,48},
                {229,216,49},
                {228,214,49},
                {227,212,49},
                {226,210,49},
                {225,208,50},
                {224,206,50},
                {223,204,50},
                {222,202,50},
                {221,200,51},
                {220,198,51},
                {219,196,51},
                {218,194,51},
                {217,192,52},
                {216,190,52},
                {215,188,52},
                {214,186,52},
                {213,184,53},
                {212,182,53},
                {211,180,53},
                {210,178,53},
                {209,176,54},
                {208,174,54},
                {207,172,54},
                {206,170,54},
                {205,168,55},
                {204,166,55},
                {203,164,55},
                {202,162,55},
                {201,160,56},
                {200,158,56},
                {200,156,56},
                {199,154,56},
                {199,152,56},
                {198,150,56},
                {198,148,56},
                {197,146,56},
                {197,144,56},
                {196,142,56},
                {196,141,56},
                {195,140,56},
                {195,139,56},
                {194,139,56},
                {194,138,56},
                {193,137,56},
                {193,136,56},
                {192,136,56},
                {192,135,56},
                {192,134,56},
                {192,133,56},
                {192,133,56},
                {192,132,56},
                {192,131,56},
                {192,130,56},
                {192,130,56},
                {192,129,56},
                {192,128,56},
                {192,127,56},
                {192,127,56},
                {192,126,56},
                {192,125,56},
                {192,124,56},
                {192,124,56},
                {192,123,56},
                {192,122,56},
                {192,121,56},
                {192,121,56},
                {192,120,56},
                {192,119,56},
                {192,118,56},
                {192,118,56},
                {192,117,56},
                {192,116,56},
                {192,115,56},
                {192,115,56},
                {192,114,56},
                {192,113,56},
                {192,112,56},
                {192,112,56},
                {192,111,56},
                {192,110,56},
                {192,109,56},
                {192,109,56},
                {192,108,56},
                {191,107,56},
                {190,106,56},
                {189,106,56},
                {188,105,56},
                {187,104,56},
                {186,103,56},
                {185,103,56},
                {184,102,56},
                {183,101,56},
                {182,100,56},
                {181,100,56},
                {180,99,56},
                {179,98,56},
                {178,97,56},
                {177,97,56},
                {175,96,55},
                {174,95,55},
                {172,94,55},
                {171,94,55},
                {169,93,54},
                {168,92,54},
                {167,91,54},
                {165,91,54},
                {164,90,53},
                {162,89,53},
                {161,88,53},
                {159,88,53},
                {158,87,52},
                {157,86,52},
                {155,85,52},
                {154,85,52},
                {152,84,51},
                {151,83,51},
                {149,82,51},
                {148,82,51},
                {147,81,50},
                {145,80,50},
                {144,79,50},
                {142,78,50},
                {141,77,49},
                {139,76,49},
                {138,75,48},
                {137,75,47},
                {135,74,47},
                {134,73,46},
                {132,72,45},
                {131,72,45},
                {129,71,44},
                {128,70,43},
                {127,69,43},
                {125,69,42},
                {124,68,41},
                {122,67,41},
                {121,66,40},
                {119,66,39},
                {118,65,39},
                {117,64,38},
                {115,63,37},
                {114,63,37},
                {112,62,36},
                {111,61,35},
                {109,60,34},
                {108,60,33},
                {107,59,32},
                {105,58,31},
                {104,57,29},
                {102,57,28},
                {101,56,27},
                {99,55,26},
                {98,54,25},
                {97,54,24},
                {95,53,23},
                {94,52,21},
                {92,51,20},
                {91,51,19},
                {89,50,18},
                {88,49,17},
                {87,48,16},
                {85,48,15},
                {84,47,13},
                {82,46,12},
                {81,45,11},
                {79,45,10},
                {78,44,9},
                {77,43,8},
                {75,42,9},
                {74,42,9},
                {72,41,10},
                {71,40,10},
                {69,39,11},
                {68,39,11},
                {67,38,12},
                {65,37,12},
                {64,36,13},
                {62,36,13},
                {61,35,14},
                {59,34,14},
                {58,33,15},
                {57,33,15},
                {55,32,16},
                {54,31,16},
                {52,30,17},
                {51,30,17},
                {49,29,18},
                {48,28,18},
                {47,27,19},
                {45,27,19},
                {44,26,20},
                {42,25,20},
                {41,24,21},
                {39,24,21},
                {38,23,22},
                {37,22,21},
                {37,22,21},
                {36,22,21},
                {36,21,20},
                {35,21,20},
                {35,21,20},
                {34,20,19},
                {34,20,19},
                {33,20,19},
                {33,19,18},
                {32,19,18},
                {32,19,18},
                {31,18,17},
                {31,18,17},
                {30,18,17},
                {30,17,16},
                {29,17,16},
                {29,17,16},
                {28,16,15},
                {28,16,15},
                {27,16,15},
                {27,15,14},
                {26,15,14},
                {26,15,14},
                {25,14,13},
                {25,14,13},
                {24,14,13},
                {24,13,12},
                {23,13,12},
                {23,13,12},
                {22,12,11},
                {22,12,11},
                {21,12,11},
                {21,11,10},
                {20,11,10},
                {20,11,10},
                {19,10,9},
                {19,10,9},
                {18,10,9},
                {18,9,8},
                {17,9,8},
                {17,9,8},
                {16,8,7},
                {16,8,7},
                {15,8,7},
                {15,7,6},
                {14,7,6},
                {14,7,6},
                {13,6,5},
                {13,6,5},
                {12,6,5},
                {12,5,4},
                {11,5,4},
                {11,5,4},
                {10,4,3},
                {10,4,3},
                {9,4,3},
                {9,3,2},
                {8,3,2},
                {8,3,2}};            

                double srm = EBC / 1.97;
                int index = Convert.ToInt32( Math.Round(srm * 10));
                if (index > 300)
                {
                    index = 300;
                }
                
                return Color.FromArgb(Farbe[int(index)-1][0], Farbe[int(index)-1][1], Farbe[int(index)-1][2]);----> hier ist der Fehler
            }

    MfG Uwe


    Mittwoch, 25. Januar 2017 01:41

Antworten

Alle Antworten