In Runescape, you can color text on interfaces using <col=HEX_CODE>*text*</col> or <col=number>*text*</col>, but in the cache's itemdefs, colors are defined using a Short. You can use this method if you want to create some recolors or dont have the know how on how to add models, but overusing this recolor method will eventually have effects on a client's performance, so beware.
Now, the most easily understood color scheme (or color space\color gamut if you want to sound fancy) is RGB\RGBA. RGB\A has existed in nearly the same format since it was conceived, and it is quite simple to look at and understand.
Here's an example
The black characters represent the alpha value. The lower the alpha value, the more transparent the color is.
The other characters represent their specific color values, higher being more of that color's presence in the current color.
If RGB were to be a 3d graph, here is what it would look like (ty wikipedia)
You may recognize this if you know how to color your yells in a servers chatbox (if allowed of course). Important to note, the runescape chatbox doesn't care about alpha value, so you only ever have to put in 6 characters.
Back to the main point. The runescape model renderer uses a different color space in a customized size to render colors on models, it uses the HSL (Hue, Saturation, Luminosity) color space (at least up to client revision 718) and takes up 16 bits.
::yell <col=FF0000> hi </col>
Here is how HSL is represented in the data
You can see that I only used 1s and 0s, and thats because this 16 bit HSL format has an irregular amount of bits for each value and it would be extremely inconvenient trying to find out the values solely from looking at the hexadecimal values like you can easily do with RGB.
Take a look back at the RGB cube, the HSL graph is quite different.
This is how runescape reads colors, using a graph very much like this.
Now, here's some code you can use to convert your RGB to HSL, or RGB to Short
Repl.it link HERE. (Repl.it is a free easy online way to run python code, you don't have to download python, don't have to trust the code because it won't be running on your machine it runs on repl.it's machines probably in sandboxes).
Now, how do you use this?
The first way I will show you is using RSCEdit, a really neat tool made by @Admiral_Slee that you can use to edit nearly all 508+ revision caches almost flawlessly, osrs coming soon i think.
Here, I am looking at the data for Green dye (id 1771). Most of the dyes using this same model are actually the same model, but runescape's itemdefs allow you to change specific colors if you know the color you want to change. The default color that is changed to green is color 61. Putting that in to my converter returns a really boring grey (123, 123, 123) or #7B7B7B.
And lo and behold, putting 22449 in to the converter returns the same vivid green as seen on Green dye TV.
Say I want to change this green dye to a... dark cyan dye... uh turqoise thats the one. picking a roughly turqoise color on any ol color picker with an RGB value box gave me (55, 163, 190). Put that in to the ol converter, you should get 25169. Replace the 22449 with 25169.
boom its turqoise. it will probably look different in game, as the ingame renderer has some rendering differences compared to the rscedit renderer.
But nbness, what if i don't have $25 to use RSCEdit to edit my cache to make a lime whip? I gotchu.
Somewhere in your client, if you have custom items there should be a section where you can define custom itemdefs (if your client is modified enough to allow it, that is. not all clients may have this ability).
Your custom itemdefs should look similar to this. i took this off a google search, but it said lime whip so im sticking with it. The red lines are the important ones here.
itemDef.modifiedModelColors = new int
itemDef.actions = new String;
itemDef.modifiedModelColors = new int;
itemDef.originalModelColors = new int;
itemDef.actions = "Wield";
itemDef.modelID = 5412;
itemDef.maleEquip1 = 5409;
itemDef.femaleEquip1 = 5409;
itemDef.modelZoom = 840;
itemDef.modelRotation1 = 280;
itemDef.modelRotation2 = 0;
itemDef.modelOffset1 = -2;
itemDef.modelOffset2 = 56;
itemDef.anInt204 = 0;
itemDef.name = "Lime Whip";
itemDef.description = "A Lime Abyssal Whip".getBytes();
itemDef.modifiedModelColors = 17350;
itemDef.originalModelColors = 528;
itemDef.originalModelColors = new int
These 2 lines set the amount of colors you are able to change. Right now, it is set to 1, but if you want to change 2 colors, change the 1 there to 2. 3 colors to 3. etc.
528 is the original color, and looks like its the dark part of the whip. They are replacing color 528 with color 17350, which is a green.
itemDef.modifiedModelColors = 17350
idemDef.originalModelColors = 528
If you want another color, add another line but with a number up in the brackets next to the modifiedModelColors and originalModelColors e.g. originalModelColors, modifiedModelcolors
The numbers in the brackets must match if you are wanting to replace the colors correctly.
Now, how do you find the color? This will require you to have some sort of tool to dump or extract models from a cache, as well as a tool called (click here for) DatMaker and a program called (click here for) MetaSequoia. My extractor tool is RSCEdit.
For an example, I will be using the Divine Sigil.
The first step is to extract your model from your cache into .dat format and open it in DatMaker. It should look like this.
Now, click File, click Export, click MQOv2. This creates a file where your previous file is that can be opened in Metasequoia. The file will be named the same thing but with a V2 at the end and a .MQO extension instead of a .DAT extension.
Now open Metasequoia and open your newly created file, your screen should look similar
in the bottom right hand side, you see a bunch of colors with numbers next to them, these are called Materials. Scroll all the way to the bottom of that and you will find the materials you need to investigate. Notice how I have 2 materials, that is because the divine sigil isnt actually shaded with lighting, its because the divine sigils sides are different colored materials.
the important part is to look at the numbers, these are the numbers you want to put in the originalModelColors array. If there are a lot of different colors, I do advise you to change the material colors (the name wont change, don't worry) so you know exactly which color you are changing and where it will be changed.
say i wanted to change my divine sigil in to a lime sigil, I would add 20643 to originalModelColors and then I would find the RGB for a really obnoxious lime color say (85, 255, 0) or 18431. This is what it would look like in the client, without the skeleton lines and dots and whatever.
Hope you enjoy