Farben erweiterung

Discussion in 'General Discussion - DE (German)' started by startege1, March 18, 2015.

  1. startege1

    startege1 Active Member

    Messages:
    355
    Likes Received:
    58
    Hi,

    Ich habe herausgefunden wie man die Farben von:
    cola_colin oder von burntcustard in PA einfügt. Dadurch hat man eine größere Auswahl an Farben. Die Farben kann man aber nur bei KI oder bei Local Host spielen verwenden "gehen nicht online".

    In dem Ordner: C:\Program Files (x86)\Steam\steamapps\common\Planetary Annihilation\media\server-script\lobby

    da gibt es eine Datei mit dem Namen "color_table"

    die müsst ihr öffnen und alles löschen (könnt ja eine Sicherungskopie machen).

    Jetzt kann man einfach die 100 Farben von cola_colin:
    (https://forums.uberent.com/threads/wip-dedicated-servers.65077/#post-1017671)

    Code:
    exports.data = (function() {
        var MAX_COLORS = 100;
      
      
    /**
    * HSV to RGB color conversion
    *
    * H runs from 0 to 360 degrees
    * S and V run from 0 to 100
    *
    * Ported from the excellent java algorithm by Eugene Vishnevsky at:
    * http://www.cs.rit.edu/~ncs/color/t_convert.html
    */
    function hsvToRgb(h, s, v) {
        var r, g, b;
        var i;
        var f, p, q, t;
      
        // Make sure our arguments stay in-range
        h = Math.max(0, Math.min(360, h));
        s = Math.max(0, Math.min(100, s));
        v = Math.max(0, Math.min(100, v));
      
        // We accept saturation and value arguments from 0 to 100 because that's
        // how Photoshop represents those values. Internally, however, the
        // saturation and value are calculated from a range of 0 to 1. We make
        // That conversion here.
        s /= 100;
        v /= 100;
      
        if(s == 0) {
            // Achromatic (grey)
            r = g = b = v;
            return [Math.round(r * 255), Math.round(g * 255), Math.round(b * 255)];
        }
      
        h /= 60; // sector 0 to 5
        i = Math.floor(h);
        f = h - i; // factorial part of h
        p = v * (1 - s);
        q = v * (1 - s * f);
        t = v * (1 - s * (1 - f));
    
        switch(i) {
            case 0:
                r = v;
                g = t;
                b = p;
                break;
              
            case 1:
                r = q;
                g = v;
                b = p;
                break;
              
            case 2:
                r = p;
                g = v;
                b = t;
                break;
              
            case 3:
                r = p;
                g = q;
                b = v;
                break;
              
            case 4:
                r = t;
                g = p;
                b = v;
                break;
              
            default: // case 5:
                r = v;
                g = p;
                b = q;
        }
      
        return [Math.round(r * 255), Math.round(g * 255), Math.round(b * 255)];
    }
    
    function randomColors(total) {
        var i = 360 / (total - 1); // distribute the colors evenly on the hue range
        var r = []; // hold the generated colors
        for (var x=0; x<total; x++)
        {
            r.push(hsvToRgb(i * x, 100, 100)); // you can also alternate the saturation and value for even more contrast between the colors
        }
        return r;
    }
    
    var p = randomColors(MAX_COLORS);
    
    var result = [];
    
    for (var i = 0; i < MAX_COLORS; i++) {
        result.push({
        primary: p[i],
        secondary: [p[p.length-1-i]]
        });
    }
    
    return result;
    
    }());
    
    oder die 32 Farben von burntcustard:

    Code:
     var brightWhite = [230,230,230],
                white = [200,200,200],
               silver = [150,150,155],
                black = [060,060,060],
            darkBlack = [040,040,040],
    
              justRed = [255,  0,  0],
             lightRed = [235, 60, 54],
                  red = [210, 50, 44],
              darkRed = [186, 26, 26],
             burgundy = [123, 22, 33],
    
                 gold = [200,150, 30],
             darkGold = [175,140,  0],
    
             iceWhite = [215,238,228],
              iceBlue = [180,234,255],
            lightBlue = [ 51,151,197],
                 blue = [ 59, 54,182],
             navyBlue = [  0, 51,102],
    
          lightYellow = [219,220, 47],
               yellow = [255,190, 20],
    
               orange = [255,144, 47],
           darkOrange = [197, 83,  0],
    
             skinPink = [240,194,170],
            lightPink = [255,122,204],
               violet = [153,153,255],
      elodeamelonPink = [255, 50,100],
                 pink = [206, 51,145],
               purple = [113, 52,165],
           darkPurple = [ 79, 47, 79],
    
                 cyan = [ 93,242,255],
             darkCyan = [  0,139,149],
    
            mintGreen = [180,255,180],
            limeGreen = [110,225, 10],
           oliveGreen = [105,120,  0],
           lightGreen = [ 50,220,110],
                green = [ 83,159, 48],
            darkGreen = [  0, 70,  0],
    
    fluorescentJacket = [209,255, 56],
    
                slate = [ 47, 79, 79],
    
                 bone = [255,250,205],
                  tan = [210,180,140],
                brown = [142,107, 68],
         giraffeBrown = [130, 80, 10];
    
    exports.data = [
        {
            primary: black,
            secondary: [
                red,
                pink,
                lightBlue,
                green,
                orange,
                gold,
                silver
            ]
        },
        {
            primary: silver,
            secondary: [ red, darkBlack, lightBlue, limeGreen ]
        },
        {
            primary: slate,
            secondary: [ darkPurple, orange, brown ]
        },
        {
            primary: navyBlue,
            secondary: [ limeGreen, elodeamelonPink, tan ]
        },
        {
            primary: brown,
            secondary: [ tan, purple, pink, mintGreen ]
        },
        {
            primary: purple,
            secondary: [ lightBlue, gold, white ]
        },
        {
            primary: blue,
            secondary: [ yellow, orange, iceWhite ]
        },
        {
            primary: darkGreen,
            secondary: [ lightYellow, white, pink ]
        },
        {
            primary: darkRed,
            secondary: [ gold, white, purple, black ]
        },
        {
            primary: red,
            secondary: [ lightBlue, green, yellow ]
        },
        {
            primary: burgundy,
            secondary: [ cyan, bone, limeGreen ]
        },
        {
            primary: elodeamelonPink,
            secondary: [ lightGreen, justRed, purple ]
        },
        {
            primary: pink,
            secondary: [ orange, lightBlue, yellow ]
        },
        {
            primary: lightPink,
            secondary: [ black, burgundy, brightWhite ]
        },
        {
            primary: cyan,
            secondary: [ purple, navyBlue, yellow ]
        },
        {
            primary: bone,
            secondary: [ darkGreen, darkRed, purple ]
        },
        {
            primary: yellow,
            secondary: [ giraffeBrown, darkBlack, burgundy, slate ]
        },
        {
            primary: orange,
            secondary: [ black, slate, lightBlue ]
        },
        {
            primary: white,
            secondary: [ red, lightBlue, green, orange, black ]
        },
        {
            primary: limeGreen,
            secondary: [ darkRed, darkGreen, navyBlue ]
        },
        {
            primary: tan,
            secondary: [ oliveGreen, blue, purple ]
        },
        {
            primary: iceBlue,
            secondary: [ brightWhite, darkRed, orange ]
        },
        {
            primary: lightBlue,
            secondary: [ gold, red, elodeamelonPink ]
        },
        {
            primary: violet,
            secondary: [ lightPink, lightRed, purple ]
        },
        {
            primary: green,
            secondary: [ yellow, pink, purple ]
        },
        {
            primary: oliveGreen,
            secondary: [ purple, bone, violet ]
        },
        {
            primary: mintGreen,
            secondary: [ brown, navyBlue, violet ]
        },
        {
            primary: darkGold,
            secondary: [ purple, lightBlue, silver ]
        },
        {
            primary: darkCyan,
            secondary: [ black, brightWhite ]
        },
        {
            primary: skinPink,
            secondary: [ darkRed, purple, darkCyan ]
        },
        {
            primary: darkOrange,
            secondary: [ darkGreen, purple, darkCyan ]
        },
        {
            primary: fluorescentJacket,
            secondary: [ black, lightBlue, purple, silver ]
        }
    ];
    einfügen.

    Wenn man jetzt ein Match gegen die KI startet kann man alle Farben auswählen.

    ps. Bis jetzt sind mir keine Nebenwirkungen aufgefallen.
    tunsel11 and DeathByDenim like this.

Share This Page