How to Add Colors to your mod
How it all works
ColorsMod works by using a system of tags to define which items can be used to create (or be created from) colored objects. This tag system lets modders, like you, add color to your mod without it being totally dependent on my mod. In other words, you can add colors to your mod with out it crashing if my mod isn’t installed.
If you just want to dig around in my code, you can have a look at it here on github.
How to have an item/plant produce dye
Allowing an item to be crafted into dye is a simple process, simply add the appropriate tags to the item following this format:
[color] colorsource
Colors you can use are: undyed, red, orange, yellow, green, blue, and purple.
So adding a blue color souce to a flower (such as i did with frostsnaps) would look like this:
“tags” : “plant blue colorsource”
If you are modifying an existing item from another smod, you need to create a mixinto for it. Go here or here for instructions on creating mixintos.
How to add colored items
Creating new items can be a tricky business, and is beyond the scope of this section. I’m just going to give you a few pointers on editing models/recipes. For more information about creating new items go here.
Here are some sniplets of code; using these you should be able to modify your own json files no problem.
Modifying a recipe to use a colored and only a colored item:
This recipe uses 1 log and 1 blue clothbolt.
"ingredients": [
{
"material" : "wood resource",
"count" : 1
},
{
"material" : "blue cloth resource",
"count" : 1
}
]
Simply replace blue with another color to use that color instead.
Colors you can use are: undyed, red, orange, yellow, green, blue, and purple.
That’s it!
Producing more than one item with a recipe:
Sometimes it just doesn’t make sense for recipes to only produce one item, here is a simple trick to overcome that.
"produces": [
{
"item":"colors-base:thread_blue"
},
{
"item":"colors-base:thread_blue"
},
{
"item":"colors-base:thread_blue"
}
]
This recipe produces 3 blue thread spools.
Recoloring an existing object using qubicle (Method 1: Hue Slider)
I am semi-working on a program which will be able to turn one .qb into several recolored qb, but until that is finished you can use either of these methods to quickly recolor any model.
Recolorer is complete and can be found here!
-
Select all of the voxels which are going to be recolored:
-
Click the Hue/Saturation Button
-
This will bring up the Hue/Saturation Dialog Box and detach the selected voxels.
Simply movethe Hue slider to change the color of the selected voxels(messing with the other sliders can be fun too!)
-
After you have fiddled around with the sliders and found a color you like simply click the OK button
Starting with “stonehearth blue” -105 will give you a nice red color.
-
Hit [ENTER] on you keyboard to attach the seperated voxels, and [CTRL]+[D] to deselect them.
Tada! A finished recoloration of the comfy chair.
All that’s left to do is export it as a .QB file. Be sure to use the settings pictured below.
What Colors to use to match this mod
Below is a super hi-tech table of the pigments I used while making these mods:
| COLOR | HUE | SAT | VAL |
|---------|-----|---------|---------|
| red | 0 | 200-250 | 210-90 |
| orange | 30 | 200-250 | 210-90 |
| yellow | 60 | 200-250 | 210-90 |
| green | 125 | 200-250 | 210-90 |
| blue | 210 | 200-250 | 210-90 |
| purple | 275 | 200-250 | 210-90 |
| undyed | 40 | 30 | 210-90 |
|---------|-----|---------|---------|
As more colors come out I will add them to the above table.
Where there is a range of values(such as 200-250) the number on the left is for lighter shades and the number on the right is for darker shades. So 0,200,210 makes a light red, while 0,250,90 produces a dark red,
Note: If you use Method 1 for recoloring with the hue slider, you will have to halve the hue results of this table to get accurate colors. For example, if you are starting with a red object, and you want to make it green, you need to slide the hue to 125/2 which is 62
I hope you enjoyed these mini-tutorials, there are more on the way!
Comming up next:
- Recoloring an existing object using qubicle (Method 2: Color Maps)