Forums › English Language Forums › General › Wiki Editors

Search

Color Codes?

10 replies [Last post]
Mon, 12/31/2018 - 17:08
Pharik's picture
Pharik

Trying to fill in some Wiki-blanks on the Color Pattern page.

Where were the color codes for the primary, secondary, and tertiary colors found or sourced?
Are they from somewhere in the game's code, or simply as close a guess the community could make?

For reference, these 3-color sets form the "color patterns" we all know and love, such as Dusky and Hallow.

Thoughts?

Mon, 12/31/2018 - 20:03
#1
Bopp's picture
Bopp
don't know

You're working on a part of the wiki that I don't know about. So I can't help you. I'm just here to offer encouragement.

Tue, 01/01/2019 - 21:36
#2
Flowchart's picture
Flowchart
do know

There are two ways to do it, the first one is looking at the game files, for this we need to know what the internal color for the new value is. Like Cool is 'blu', Military is 'grn' etc.

Usually this can be found by opening up Spiral Spy, putting up a character model with a recolor item, then scrolling to the bottom to see what the new color is. Spiral Spy seems to be broken right now though...

inside the file code\projectx-config.jar, it's rsrc\config\media\colordefs.dat
You'll have to read it with a hex editor. Search for that new color name and you'll see it three times. Then you can find the modifier numbers (in hex)

If you modify red, blue, green with those by shifting the hue/lightness/saturation then you will get the new base color values.

There is another option that is easier, but I wouldn't recommend since it's modifying the game files.

Create an image with four primary colors (red, blue, green, magenta)
and replace one of the icon files from rsrc\ui\icon\inventory with it.
Then look for an item using that same icon, with the color style you want. The primary colors will be replaced with the recolors. Screenshot and grab the colors using a paint program.

A safer (possibly) method of doing this is using the model for an item drop in Spiral Spy and have it use that icon.

Tue, 01/01/2019 - 21:40
#3
Flowchart's picture
Flowchart

Didn't see your other post.
Things like "Proto" aren't official recolor codes, sometimes the devs use custom colored icons or icons using a different color code. So they are usually estimated. Or just left blank, lol.

Wed, 01/02/2019 - 18:26
#4
Pharik's picture
Pharik
Looking in the media files

Looking in the media files where you said, but it appears empty- it shows no files in the media folder for me. Also mine says, "...projectx-config.jarv" with a separate JAR file adjacent to it.

Thu, 01/03/2019 - 05:15
#5
Nitronicx
.jar

You have to open the .jar and then go to rsrc/config... You can imagine it as an archive file, like .rar or .zip. You should be able to open it with any archiver program (WinRAR, 7Zip...).

Fri, 01/04/2019 - 21:33
#6
Pharik's picture
Pharik
aaand I'm back

Ok, so I got into the config jar file and the colordefs.dat file (thank you Flowchart and Nitronicx!). I can see all the bytes on the left and color names on the right via a hex editor. However, I am having trouble finding the colors' actual hex codes or anything of the sort... the bytes translate to the color names but the color codes don't seem to be visible in bytes or text form. At the risk of this becoming an impromptu code-reading class of sorts, I gotta ask,

"What do I do now to view the colors' hex codes, not just their names?" For example, I'd like to be able to see Regal's "#C5922D". I only know this code from the color patterns wiki page, fyi.

Mon, 01/07/2019 - 07:30
#7
Nitronicx
floats

I tried to follow the instructions too, but there's lot to figure out to get the colors the hard way. It took my quite some time.

The numbers are after the color's name. They start after byte 0x03 and end before byte 0x77 (w). Between these 2 bytes are 12 bytes with your "modifier numbers." They are stored as floats (32-bit) in big endian byte order and describe how much hue/saturation/brightness change, respectively. All 3 numbers should be between -1 and 1 where 1 means biggest possible change (for example if hue is a number from 0 to 360, you would add 360 to the current hue value) and 0 means no change.

After each section with the 3-letter color names is short line like "armor_joint", "armor_primary" or "armor_secondary." This is a hint telling you to which of the 3 colors the numbers apply. Primary means for red, secondary for blue and joint (tertiary) for green. I found them in order: joint, primary, secondary.

I tried to calculate the color codes for Cool color pattern using this method, but the resulting color was always slightly off from the value on the wiki.

Mon, 01/07/2019 - 22:28
#8
Flowchart's picture
Flowchart

If we do a search for 'gld' the first one comes up at 19EE (this may change if the game gets updated)
what we look for after that is 00 00 00 03 which means there are these numbers after it
3E 92 6E 98 BE CE D9 17 BF 22 0C 4A
since they are 3 sets of bytes, we can group them like this
3E926E98 BECED917 BF220C4A
then convert them into floating point, here is a site that can do it for you.
so we get 0.286, -0.404, -0.633.

The first color uses green as its reference color.
Colors are always taken as hsv ranging from 0 to 1.
When converting, you might get a hue from 0-360 and s/v from 0-255, divide these numbers if necessary.
So green would be hue 120/360 (0.333), saturation 255/255 (1), brightness 255/255 (1).

then add:
hue = 0.333 + 0.286 = 0.619
sat = 1 - 0.404 = 0.596
val = 1 - 0.633 = 0.367

You can then convert this back into rgb, paint programs should let you use hsv in their color pickers, multiply these decimal numbers if needed first.

Anyway you end up getting #26365e, which is the third number listed on Color Pattern.

So the other colors:
location 2E0A, bytes are 3DE353F8, BE6B851F, BE6872B0
or: 0.111, -0.23, -0.227
this uses red for its recolor.
hue = 0 + 0.111 = 0.111
sat = 1 - 0.23 = 0.77
val = 1 - 0.227 = 0.773
= #c5922d

location 5955, bytes are BF000000, BEAB020C, BEFAE148
or: -0.5, -0.334, -0.49
this uses blue for its recolor.
hue = 0.667 - 0.5 = 0.167
sat = 1 - 0.334 = 0.666
val = 1 - 0.49 = 0.51
= #82822b

it's better do this in code or else you might get numbers that are slightly off due to rounding.

They made the code for this part open source, it's available here.

Mon, 01/07/2019 - 22:25
#9
Flowchart's picture
Flowchart

For Cool:
red
h: 0 + 0.588 = 0.588, * 360 = 211.7
s: 1 - 0.315 = 0.685
v: 1 - 0.338 = 0.662
= #356ca9

blue
h: 0.667 - 0.060 = 0.607, * 360 = 218.5
s: 1 - 0.735 = 0.265
v: 1 - 0.413 = 0.587
= #6e7c96

green
h: 0.333 + 0.210 = 0.543, * 360 = 195.5
s: 1 - 0.632 = 0.368
v: 1 - 0.656 = 0.344
= #374f58
(I'm using gimp for the rgb conversion here, since you can enter in decimals)

Fri, 01/11/2019 - 10:10
#10
Nitronicx
Thank you!

Thank you!

Powered by Drupal, an open source content management system