Pack Making JSON Colors - DonBruce64/MinecraftTransportSimulator GitHub Wiki
Color values in an MTS JSON are somewhat flexible. The currently accepted formats are Hexadecimal and HSV.
Hexadecimal color codes:
Hexadecimal color codes are a 6 character code. The characters range from 0 to 9, then from A till F. It's split into 3 parts, with 2 characters each. Each part represents the Red, Green and Blue parts of the color.
Take, for instance, FF0000
, this color code tells us that it is 100% red, 0% green and blue, since F is the highest value/character. Usually you won't need to write your own color codes, but it's good to have some knowledge about it.
The accepted prefixes are #
, 0x
, although they aren't required. They are written as a string, i.e. within ""
. For example: #BABA00
= Dark Yellow.
HSV ( Hue | Saturation | Value ):
HSV is a great way to write readable color values, given that you know what the color wheel looks like.
The above image is an HSV color wheel.
There are three values in the HSV format: Hue, Saturation and Value. All three values, together, specify a point that is chosen on the color wheel. They are written as an array, [hue, saturation, value]
. For example: [120, 100, 50]
Hue: This value represents the angle of the point on the color wheel. Giving a value of
120
, would get you a color of Green. The min-max range of this value is0
-360
.
Saturation: This value represents the distance of the point from the center of the color wheel. It basically tells what percentage of the color is added, i.e a value of
0
is fully white, and100
is the original color, as-is. Values of0
-100
is accepted.
Value: This is also called brightness. A value of
0
is black, and100
is the original color. Values of0
-100
is accepted.