I am going to walk you through how to change the Celtics green out of bounds and lane colors to their Saint Patty's Day gold. So first we need to get the RGB (Red, Green, Blue) values of that gold.
Alright, so open the Celtics court up (f005.iff) in the hex editor of your choice. I use Hex Workshop, but as long as your editor has a Base Converter and basic Find, Find/Replace tools you should be OK.
Alrighty, so the first thing we want to do is run a search for the following Hex, press CTRL + F to search.
- Code: Select all
FFFFFFFF000000000000000000000000FFFFFFFF
Now we want to find the 2nd instance of that in the file. Then we want to look "up" in the file for the "0000 803F" in the first two columns. The part circled in red is the Celtics green we want to change.
For those that know a bit more about hex, you want to look 8c bytes before the first instance of the code we searched for.
Alright, so this is where it gets tricky. This area circled in red above contains the RGB for that Celtics green. What we need to do is convert the hex shown to Float (32 bit) values so we can get those into RGB numbers. We need to start looking at the hex like this.
- Code: Select all
| Red | Green | Blue |
DDBC 173E 4260 B13E 76AE 463E 0000803F
Hex Workshop automatically converts your selection into various things, like (un)signed bytes, (un)signed short/long, and what we need, Float values. Here are the 3 Float values that correlate to the RGB in that hex.
Now we need to convert those decimals into RGB values. White is what you get when you max out the RGB scale, which is 255, 255, 255. Black is 0, 0, 0. These decimals we just obtained from that hex are actually relate to that 255 scale. To get the RBG values we need to multiply those decimals by 255.
If we plug the RGB of 43, 101, 48 into GIMP or Pain, or whatever you use, that green looks familiar.
So, if we multiply by 255 to go from decimal to RGB, we need to divide our custom RGB by 255 to get our Float decimals.
Now that we have our Float values, we need to convert those to hex. I'm sure there is a website that will do this online, but Hex Workshop comes with a Base Converter which allows us to do the conversion in the program.
You need to make sure that you choose "Intel" for the Byte Order and "float (32)" as the Data Type. You then want to input your decimal in the Decimal box and then copy out your generated Hex. Copy these out into notepad.
So we should have this
Now string them all together Red first, then Green, then Blue, and add the 0000803F at the end. You want to do a find/replace (CTRL + H in hex workshop), finding the original Celtics green hex, and replacing it with your new color.
You want to make sure that you replace exactly the same amount as you find or else you will corrupt the file by changing the file size. The number of occurrences differs from court to court and depends if the court has multiple paint colors.
Now that will replace all the green with the gold on the Celtics court, that means the out of bounds and both lane colors will be gold now. Courts with multiple colors on it, like the Lakers with the Purple lanes and Yellow out of bounds, will require you to look at the other instances of this code,
- Code: Select all
FFFFFFFF000000000000000000000000FFFFFFFF
and manually try to locate those colors. Unfortunately again, these color locations differ from court to court so we cannot simply have a list of offsets that cover them all.