Welcome, guest! Please login or register.

    * Shoutbox

    RefreshHistory
    • SantaHoHo: you wont regret when u join really nice server
      December 10, 2019, 06:35:18 PM
    • SantaHoHo: need staff :)
      December 10, 2019, 06:35:08 PM
    • SantaHoHo: divinescape.eu5.org
      December 10, 2019, 06:35:00 PM
    • SantaHoHo:[link]
      December 10, 2019, 06:34:39 PM
    • Moneyking800: Yanille is back! We’re in beta looking for new players. We are small around 5-10 players on at anytime atm looking for active testers to build off of! Yanille-os.com
      December 10, 2019, 06:14:45 PM
    • drubrkletern: be honest with me boss
      December 06, 2019, 01:31:52 AM
    • drubrkletern: now is it really that unique
      December 06, 2019, 01:31:47 AM
    • SuperNativeZ: COME PLAY THE MOST UNIQUE CUSTOM RSPS #1 [link][link][link]
      December 05, 2019, 09:22:55 PM
    • SuperNativeZ: FASTEST GROWING #1 UNIQUE CUSTOM RSPS [link][link][link]
      December 05, 2019, 09:22:42 PM
    • ragnoroker: New Server - Unique - Awesome Community - Start your adventure - 60+ online : [link]
      December 05, 2019, 02:48:39 PM
    • ragnoroker: New Server - Unique - Awesome Community - Start your adventure - 40+ online : [link]
      December 05, 2019, 02:48:31 PM
    • Cole1497: you click any of these links? those boner pills theyre selling are wicked
      December 04, 2019, 05:58:03 PM
    • Cole1497: oh shit vain whats crackin
      December 04, 2019, 05:57:49 PM
    • ArtexAdv: FASTEST GROWING #1 UNIQUE CUSTOM RSPS [link]
      December 04, 2019, 06:30:27 AM
    • Vain_: where the boys at
      December 01, 2019, 03:20:36 PM
    • black evil111: They should close this down, mostly the downloads section. The mods dont know how to do their jobs worth shit and its no excuse like "we have real life stuff going on" everyones replacable. Speaking of replacable, fix download links! Before I go to rune-server.
      December 01, 2019, 01:50:26 PM
    • ragnoroker: New Server - Unique - Awesome Community - Start your adventure - 40+ online : [link]
      November 28, 2019, 12:41:24 PM
    • ragnoroker: New Server - Unique - Awesome Community - Start your adventure - 40+ online : [link]
      November 28, 2019, 12:40:42 PM
    • 1strangler77: how do i post pictures on a post
      November 24, 2019, 05:16:18 PM
    • ragnoroker: New Server - Unique - Awesome Community - Start your adventure - 40+ online : [link]
      November 23, 2019, 08:23:51 PM

    Author Topic: Colour conversion for the 317 client  (Read 2055 times)

    0 Members and 1 Guest are viewing this topic.

    Offlineohokay

    • Member
    • ****
    • Posts: 1,214
    • Thanks: +0/-0
      • View Profile
    Colour conversion for the 317 client
    « on: January 20, 2015, 04:32:29 PM »
    How does one convert a hex colour value into a format that the standard 317 client can recognise? I read somewhere on rune-server that they use a modified version of HSB and posted a method in order to get the correct colour

    Code: Java
    1.     publicstaticint[] hexToHSB(int hex){
    2.         returnnewint[]{((hex & 0xfc00)>>10), ((hex & 0x380)>>7), (hex & 0x7f)};
    3.     }
    4.  

    Didn't seem to work. If anyone has any information on this it'd be appreciated.

    Edit: Apologies if this is in the wrong section.
    « Last Edit: January 20, 2015, 04:39:43 PM by ohokay »
    I don't think sk8r could be wrong because he is a god, But what do i need to do then?
    Runescape Gambling

    Offlinesk8rdude461

    • MOPARSCAPE WAS HACKED
    • Member
    • ****
    • *
    • Posts: 12,471
    • Thanks: +0/-0
      • View Profile
    Re: Colour conversion for the 317 client
    « Reply #1 on: January 20, 2015, 04:42:28 PM »
    https://forum.moparscape.org/index.php/topic,667967.0.html/

    I was having the same issue.. I can't seem to figure it out to the T..

    https://www.rune-server.ee/runescape-development/rs-503-client-server/downloads/518266-ide-model-colour-ids.html

    This guy used some tool to get the colors, but I don't really know if he got the numbers from existing models or just guessed and etc..

    This is what I was testing:
    Code: [Select]
    int h = 926;
    int rgb = h;
    rgb = (rgb << 8) + 0;
    rgb = (rgb << 8) + 0;
    System.out.println("" + rgb);
    And I believe h was a red-color I found in the client.
    I was trying to convert it from the value to RGB.. if it worked that way I could do it the other way around and, yeah.

    Offlineohokay

    • Member
    • ****
    • Posts: 1,214
    • Thanks: +0/-0
      • View Profile
    Re: Colour conversion for the 317 client
    « Reply #2 on: January 20, 2015, 04:48:30 PM »
    You can grab the model's colour through Metasequoia, just not sure how you'd convert the new colour so it's recognised by the client.
    I don't think sk8r could be wrong because he is a god, But what do i need to do then?

    Offlinesk8rdude461

    • MOPARSCAPE WAS HACKED
    • Member
    • ****
    • *
    • Posts: 12,471
    • Thanks: +0/-0
      • View Profile
    Re: Colour conversion for the 317 client
    « Reply #3 on: January 20, 2015, 04:57:13 PM »
    You can grab the model's colour through Metasequoia, just not sure how you'd convert the new colour so it's recognised by the client.
    I was using the client colors.. if that makes sense. Like
    926 is the red on a red partyhat. So I was trying to convert that into RGB. Because if I could make that into RGB, I could do the same steps backwards to get any RGB format into the client format.

    OfflineRuneAgent

    • wololo
    • Member
    • ****
    • *
    • *
    • Posts: 7,515
    • Thanks: +0/-0
      • View Profile
      • MITB FORUMS
    Re: Colour conversion for the 317 client
    « Reply #4 on: January 20, 2015, 07:06:40 PM »
    you could bruteforce it, take the color array compare your value to find the color that's closest to the value and return.


    Code: [Select]
    public class BruteForceColorFinder {

        private int[] palette;

        public void createPalette() {
            palette = new int[0x10000];
            int hsl = 0;
            for (int k = 0; k < 512; k++) {
                double d1 = k / 8 / 64D + 0.0078125D;
                double d2 = (k & 7) / 8D + 0.0625D;
                for (int k1 = 0; k1 < 128; k1++) {
                    double d3 = k1 / 128D;
                    double r = d3;
                    double g = d3;
                    double b = d3;
                    if (d2 != 0.0D) {
                        double d7;
                        if (d3 < 0.5D) {
                            d7 = d3 * (1.0D + d2);
                        } else {
                            d7 = (d3 + d2) - d3 * d2;
                        }
                        double d8 = 2D * d3 - d7;
                        double d9 = d1 + 0.33333333333333331D;
                        if (d9 > 1.0D) {
                            d9--;
                        }
                        double d10 = d1;
                        double d11 = d1 - 0.33333333333333331D;
                        if (d11 < 0.0D) {
                            d11++;
                        }
                        if (6D * d9 < 1.0D) {
                            r = d8 + (d7 - d8) * 6D * d9;
                        } else if (2D * d9 < 1.0D) {
                            r = d7;
                        } else if (3D * d9 < 2D) {
                            r = d8 + (d7 - d8) * (0.66666666666666663D - d9) * 6D;
                        } else {
                            r = d8;
                        }
                        if (6D * d10 < 1.0D) {
                            g = d8 + (d7 - d8) * 6D * d10;
                        } else if (2D * d10 < 1.0D) {
                            g = d7;
                        } else if (3D * d10 < 2D) {
                            g = d8 + (d7 - d8) * (0.66666666666666663D - d10) * 6D;
                        } else {
                            g = d8;
                        }
                        if (6D * d11 < 1.0D) {
                            b = d8 + (d7 - d8) * 6D * d11;
                        } else if (2D * d11 < 1.0D) {
                            b = d7;
                        } else if (3D * d11 < 2D) {
                            b = d8 + (d7 - d8) * (0.66666666666666663D - d11) * 6D;
                        } else {
                            b = d8;
                        }
                    }
                    int byteR = (int) (r * 256D);
                    int byteG = (int) (g * 256D);
                    int byteB = (int) (b * 256D);
                    int rgb = (byteR << 16) + (byteG << 8) + byteB;
                    if (rgb == 0) {
                        rgb = 1;
                    }
                    palette[hsl++] = rgb;
                }
            }
        }

        public BruteForceColorFinder() {
            this.createPalette();
        }

        public static void main(String args[]) {
            BruteForceColorFinder bfc = new BruteForceColorFinder();
            Color color = Color.BLACK;
            System.out.println(bfc.findBestMatch(color.getRGB()));
            color = hex2Rgb("#efefef");
            System.out.println(bfc.findBestMatch(color.getRGB()));
        }

        public int findBestMatch(int color) {
            int r = (color >> 16) & 0xFF;
            int g = (color >> 8) & 0xFF;
            int b = color & 0xFF;
            int rgb = (r << 16) + (g << 8) + b;
            int best = 0;
            int idx = 0;
            for (int c = 1; c < palette.length; c++) {
                int temp = Math.abs(palette[c] - rgb);
                if (temp == 0) {
                    return palette[c];
                }
                if (best == 0 || best > temp) {
                    idx = c;
                    best = temp;
                }
            }
            return palette[idx];
        }

        public static Color hex2Rgb(String colorStr) {
            return new Color(
                    Integer.valueOf(colorStr.substring(1, 3), 16),
                    Integer.valueOf(colorStr.substring(3, 5), 16),
                    Integer.valueOf(colorStr.substring(5, 7), 16));
        }
    }


    « Last Edit: January 20, 2015, 08:05:29 PM by Miss Silabsoft »

    Offlinesini

    • Member
    • ****
    • *
    • *
    • Posts: 5,785
    • Thanks: +0/-0
      • View Profile
    Re: Colour conversion for the 317 client
    « Reply #5 on: January 20, 2015, 11:22:23 PM »
    ^ I like this idea.

    OfflineRandQm

    • Member
    • ****
    • Posts: 4,220
    • Thanks: +0/-0
      • View Profile
    Re: Colour conversion for the 317 client
    « Reply #6 on: January 25, 2015, 12:04:59 PM »
    Looking how you guys having difficulties with this I'm probably thinking about something else but when I need colors.
    But this always worked for me where I used it, replacing # by 0x

    e.g. I wanted my sky to be blue, skyblue is in hex: #91FDFF
    In my pixels drawing method I put 0x91FDFF and It will give me blue sky.
    soldout

    contact me on [email protected] if you're looking for me

    Offlinesk8rdude461

    • MOPARSCAPE WAS HACKED
    • Member
    • ****
    • *
    • Posts: 12,471
    • Thanks: +0/-0
      • View Profile
    Re: Colour conversion for the 317 client
    « Reply #7 on: January 25, 2015, 01:16:07 PM »
    Looking how you guys having difficulties with this I'm probably thinking about something else but when I need colors.
    But this always worked for me where I used it, replacing # by 0x

    e.g. I wanted my sky to be blue, skyblue is in hex: #91FDFF
    In my pixels drawing method I put 0x91FDFF and It will give me blue sky.
    Your thinking right, but you're just in the wrong area :P
    We're talking about the colors you would use for a model, not the colors you use when drawing the game screen/etc.
    For example, you can see where the Model class reads the triangle colors here:
    Code: Java
    1.                 for(int i12 =0; i12 < numTriangles; i12++){
    2.                         triangleColours2[i12]= nc1.readUnsignedWord();
    3.                         if(l1 ==1){
    4.                                 anIntArray1637[i12]= nc2.readSignedByte();
    5.                                 if(anIntArray1637[i12]==2)
    6.                                         triangleColours2[i12]=65535;
    7.                                 anIntArray1637[i12]=0;
    8.                         }
    9.                         if(i2 ==255){
    10.                                 anIntArray1638[i12]= nc3.readSignedByte();
    11.                         }
    12.                         if(j2 ==1){
    13.                                 anIntArray1639[i12]= nc4.readSignedByte();
    14.                                 if(anIntArray1639[i12]<0)
    15.                                         anIntArray1639[i12]=(256+ anIntArray1639[i12]);
    16.                         }
    17.                         if(k2 ==1)
    18.                                 anIntArray1656[i12]= nc5.readUnsignedByte();
    19.                         if(l2 ==1)
    20.                                 D[i12]=(short)(nc6.readUnsignedWord()-1);
    21.                         if(x !=null)
    22.                                 if(D[i12]!=-1)
    23.                                         x[i12]=(byte)(nc7.readUnsignedByte()-1);
    24.                                 else
    25.                                         x[i12]=-1;
    26.                 }
    It's not the same as just using a hex value, sadly.

    Offlineohokay

    • Member
    • ****
    • Posts: 1,214
    • Thanks: +0/-0
      • View Profile
    Re: Colour conversion for the 317 client
    « Reply #8 on: January 25, 2015, 08:59:41 PM »
    you could bruteforce it, take the color array compare your value to find the color that's closest to the value and return.


    Code: [Select]
    public class BruteForceColorFinder {

        private int[] palette;

        public void createPalette() {
            palette = new int[0x10000];
            int hsl = 0;
            for (int k = 0; k < 512; k++) {
                double d1 = k / 8 / 64D + 0.0078125D;
                double d2 = (k & 7) / 8D + 0.0625D;
                for (int k1 = 0; k1 < 128; k1++) {
                    double d3 = k1 / 128D;
                    double r = d3;
                    double g = d3;
                    double b = d3;
                    if (d2 != 0.0D) {
                        double d7;
                        if (d3 < 0.5D) {
                            d7 = d3 * (1.0D + d2);
                        } else {
                            d7 = (d3 + d2) - d3 * d2;
                        }
                        double d8 = 2D * d3 - d7;
                        double d9 = d1 + 0.33333333333333331D;
                        if (d9 > 1.0D) {
                            d9--;
                        }
                        double d10 = d1;
                        double d11 = d1 - 0.33333333333333331D;
                        if (d11 < 0.0D) {
                            d11++;
                        }
                        if (6D * d9 < 1.0D) {
                            r = d8 + (d7 - d8) * 6D * d9;
                        } else if (2D * d9 < 1.0D) {
                            r = d7;
                        } else if (3D * d9 < 2D) {
                            r = d8 + (d7 - d8) * (0.66666666666666663D - d9) * 6D;
                        } else {
                            r = d8;
                        }
                        if (6D * d10 < 1.0D) {
                            g = d8 + (d7 - d8) * 6D * d10;
                        } else if (2D * d10 < 1.0D) {
                            g = d7;
                        } else if (3D * d10 < 2D) {
                            g = d8 + (d7 - d8) * (0.66666666666666663D - d10) * 6D;
                        } else {
                            g = d8;
                        }
                        if (6D * d11 < 1.0D) {
                            b = d8 + (d7 - d8) * 6D * d11;
                        } else if (2D * d11 < 1.0D) {
                            b = d7;
                        } else if (3D * d11 < 2D) {
                            b = d8 + (d7 - d8) * (0.66666666666666663D - d11) * 6D;
                        } else {
                            b = d8;
                        }
                    }
                    int byteR = (int) (r * 256D);
                    int byteG = (int) (g * 256D);
                    int byteB = (int) (b * 256D);
                    int rgb = (byteR << 16) + (byteG << 8) + byteB;
                    if (rgb == 0) {
                        rgb = 1;
                    }
                    palette[hsl++] = rgb;
                }
            }
        }

        public BruteForceColorFinder() {
            this.createPalette();
        }

        public static void main(String args[]) {
            BruteForceColorFinder bfc = new BruteForceColorFinder();
            Color color = Color.BLACK;
            System.out.println(bfc.findBestMatch(color.getRGB()));
            color = hex2Rgb("#efefef");
            System.out.println(bfc.findBestMatch(color.getRGB()));
        }

        public int findBestMatch(int color) {
            int r = (color >> 16) & 0xFF;
            int g = (color >> 8) & 0xFF;
            int b = color & 0xFF;
            int rgb = (r << 16) + (g << 8) + b;
            int best = 0;
            int idx = 0;
            for (int c = 1; c < palette.length; c++) {
                int temp = Math.abs(palette[c] - rgb);
                if (temp == 0) {
                    return palette[c];
                }
                if (best == 0 || best > temp) {
                    idx = c;
                    best = temp;
                }
            }
            return palette[idx];
        }

        public static Color hex2Rgb(String colorStr) {
            return new Color(
                    Integer.valueOf(colorStr.substring(1, 3), 16),
                    Integer.valueOf(colorStr.substring(3, 5), 16),
                    Integer.valueOf(colorStr.substring(5, 7), 16));
        }
    }



    From what I've tested, this seems to do the trick, thank you  :)
    I don't think sk8r could be wrong because he is a god, But what do i need to do then?

    OfflineRuneAgent

    • wololo
    • Member
    • ****
    • *
    • *
    • Posts: 7,515
    • Thanks: +0/-0
      • View Profile
      • MITB FORUMS
    Re: Colour conversion for the 317 client
    « Reply #9 on: January 27, 2015, 02:03:07 PM »
    you could bruteforce it, take the color array compare your value to find the color that's closest to the value and return.


    Code: [Select]
    public class BruteForceColorFinder {

        private int[] palette;

        public void createPalette() {
            palette = new int[0x10000];
            int hsl = 0;
            for (int k = 0; k < 512; k++) {
                double d1 = k / 8 / 64D + 0.0078125D;
                double d2 = (k & 7) / 8D + 0.0625D;
                for (int k1 = 0; k1 < 128; k1++) {
                    double d3 = k1 / 128D;
                    double r = d3;
                    double g = d3;
                    double b = d3;
                    if (d2 != 0.0D) {
                        double d7;
                        if (d3 < 0.5D) {
                            d7 = d3 * (1.0D + d2);
                        } else {
                            d7 = (d3 + d2) - d3 * d2;
                        }
                        double d8 = 2D * d3 - d7;
                        double d9 = d1 + 0.33333333333333331D;
                        if (d9 > 1.0D) {
                            d9--;
                        }
                        double d10 = d1;
                        double d11 = d1 - 0.33333333333333331D;
                        if (d11 < 0.0D) {
                            d11++;
                        }
                        if (6D * d9 < 1.0D) {
                            r = d8 + (d7 - d8) * 6D * d9;
                        } else if (2D * d9 < 1.0D) {
                            r = d7;
                        } else if (3D * d9 < 2D) {
                            r = d8 + (d7 - d8) * (0.66666666666666663D - d9) * 6D;
                        } else {
                            r = d8;
                        }
                        if (6D * d10 < 1.0D) {
                            g = d8 + (d7 - d8) * 6D * d10;
                        } else if (2D * d10 < 1.0D) {
                            g = d7;
                        } else if (3D * d10 < 2D) {
                            g = d8 + (d7 - d8) * (0.66666666666666663D - d10) * 6D;
                        } else {
                            g = d8;
                        }
                        if (6D * d11 < 1.0D) {
                            b = d8 + (d7 - d8) * 6D * d11;
                        } else if (2D * d11 < 1.0D) {
                            b = d7;
                        } else if (3D * d11 < 2D) {
                            b = d8 + (d7 - d8) * (0.66666666666666663D - d11) * 6D;
                        } else {
                            b = d8;
                        }
                    }
                    int byteR = (int) (r * 256D);
                    int byteG = (int) (g * 256D);
                    int byteB = (int) (b * 256D);
                    int rgb = (byteR << 16) + (byteG << 8) + byteB;
                    if (rgb == 0) {
                        rgb = 1;
                    }
                    palette[hsl++] = rgb;
                }
            }
        }

        public BruteForceColorFinder() {
            this.createPalette();
        }

        public static void main(String args[]) {
            BruteForceColorFinder bfc = new BruteForceColorFinder();
            Color color = Color.BLACK;
            System.out.println(bfc.findBestMatch(color.getRGB()));
            color = hex2Rgb("#efefef");
            System.out.println(bfc.findBestMatch(color.getRGB()));
        }

        public int findBestMatch(int color) {
            int r = (color >> 16) & 0xFF;
            int g = (color >> 8) & 0xFF;
            int b = color & 0xFF;
            int rgb = (r << 16) + (g << 8) + b;
            int best = 0;
            int idx = 0;
            for (int c = 1; c < palette.length; c++) {
                int temp = Math.abs(palette[c] - rgb);
                if (temp == 0) {
                    return palette[c];
                }
                if (best == 0 || best > temp) {
                    idx = c;
                    best = temp;
                }
            }
            return palette[idx];
        }

        public static Color hex2Rgb(String colorStr) {
            return new Color(
                    Integer.valueOf(colorStr.substring(1, 3), 16),
                    Integer.valueOf(colorStr.substring(3, 5), 16),
                    Integer.valueOf(colorStr.substring(5, 7), 16));
        }
    }



    From what I've tested, this seems to do the trick, thank you  :)

    That's cool if you ever find a better method feel free to post it here.

    OfflineZymus

    • Member
    • ****
    • *
    • Posts: 7,267
    • Thanks: +0/-0
      • View Profile
    Re: Colour conversion for the 317 client
    « Reply #10 on: January 28, 2015, 11:02:48 AM »
    I don't think it's HSB, but rather HSL.

    Offlinen10si t

    • Member
    • ****
    • Posts: 2,408
    • Thanks: +0/-0
      • View Profile
    Re: Colour conversion for the 317 client
    « Reply #11 on: January 29, 2015, 07:57:38 PM »
    you could bruteforce it, take the color array compare your value to find the color that's closest to the value and return.


    Code: [Select]
    public class BruteForceColorFinder {

        private int[] palette;

        public void createPalette() {
            palette = new int[0x10000];
            int hsl = 0;
            for (int k = 0; k < 512; k++) {
                double d1 = k / 8 / 64D + 0.0078125D;
                double d2 = (k & 7) / 8D + 0.0625D;
                for (int k1 = 0; k1 < 128; k1++) {
                    double d3 = k1 / 128D;
                    double r = d3;
                    double g = d3;
                    double b = d3;
                    if (d2 != 0.0D) {
                        double d7;
                        if (d3 < 0.5D) {
                            d7 = d3 * (1.0D + d2);
                        } else {
                            d7 = (d3 + d2) - d3 * d2;
                        }
                        double d8 = 2D * d3 - d7;
                        double d9 = d1 + 0.33333333333333331D;
                        if (d9 > 1.0D) {
                            d9--;
                        }
                        double d10 = d1;
                        double d11 = d1 - 0.33333333333333331D;
                        if (d11 < 0.0D) {
                            d11++;
                        }
                        if (6D * d9 < 1.0D) {
                            r = d8 + (d7 - d8) * 6D * d9;
                        } else if (2D * d9 < 1.0D) {
                            r = d7;
                        } else if (3D * d9 < 2D) {
                            r = d8 + (d7 - d8) * (0.66666666666666663D - d9) * 6D;
                        } else {
                            r = d8;
                        }
                        if (6D * d10 < 1.0D) {
                            g = d8 + (d7 - d8) * 6D * d10;
                        } else if (2D * d10 < 1.0D) {
                            g = d7;
                        } else if (3D * d10 < 2D) {
                            g = d8 + (d7 - d8) * (0.66666666666666663D - d10) * 6D;
                        } else {
                            g = d8;
                        }
                        if (6D * d11 < 1.0D) {
                            b = d8 + (d7 - d8) * 6D * d11;
                        } else if (2D * d11 < 1.0D) {
                            b = d7;
                        } else if (3D * d11 < 2D) {
                            b = d8 + (d7 - d8) * (0.66666666666666663D - d11) * 6D;
                        } else {
                            b = d8;
                        }
                    }
                    int byteR = (int) (r * 256D);
                    int byteG = (int) (g * 256D);
                    int byteB = (int) (b * 256D);
                    int rgb = (byteR << 16) + (byteG << 8) + byteB;
                    if (rgb == 0) {
                        rgb = 1;
                    }
                    palette[hsl++] = rgb;
                }
            }
        }

        public BruteForceColorFinder() {
            this.createPalette();
        }

        public static void main(String args[]) {
            BruteForceColorFinder bfc = new BruteForceColorFinder();
            Color color = Color.BLACK;
            System.out.println(bfc.findBestMatch(color.getRGB()));
            color = hex2Rgb("#efefef");
            System.out.println(bfc.findBestMatch(color.getRGB()));
        }

        public int findBestMatch(int color) {
            int r = (color >> 16) & 0xFF;
            int g = (color >> 8) & 0xFF;
            int b = color & 0xFF;
            int rgb = (r << 16) + (g << 8) + b;
            int best = 0;
            int idx = 0;
            for (int c = 1; c < palette.length; c++) {
                int temp = Math.abs(palette[c] - rgb);
                if (temp == 0) {
                    return palette[c];
                }
                if (best == 0 || best > temp) {
                    idx = c;
                    best = temp;
                }
            }
            return palette[idx];
        }

        public static Color hex2Rgb(String colorStr) {
            return new Color(
                    Integer.valueOf(colorStr.substring(1, 3), 16),
                    Integer.valueOf(colorStr.substring(3, 5), 16),
                    Integer.valueOf(colorStr.substring(5, 7), 16));
        }
    }



    This horrified me. Is this really the best way to do it? It seems so... over the top

    OfflineRuneAgent

    • wololo
    • Member
    • ****
    • *
    • *
    • Posts: 7,515
    • Thanks: +0/-0
      • View Profile
      • MITB FORUMS
    Re: Colour conversion for the 317 client
    « Reply #12 on: January 29, 2015, 08:14:52 PM »
    realistically you will need to do either a conversion or a validation you have to remember that Jagex uses in house software the palette is proprietary therefore no modeling software will have this palette specifically. It's probably possible to create a plugin for one of the modeling softwares to have this palette available. At the end of the day you are going to be converting your model to the rsformat it can run pass color conversion at the same time.

     

    Copyright © 2017 MoparScape. All rights reserved.
    Powered by SMFPacks SEO Pro Mod |
    SimplePortal 2.3.5 © 2008-2012, SimplePortal