Colors are in hex. If you look at a color editor, you see the colors broken up into rgb values, from 0 to 255 (in hex, 0 to FF). The coding takes the colors converted into hex numbers, the hex numbers are just converted to decimal. You can use 0x______ to not need a conversion. E.g. 0xFF0000 is bright red. Try it with any of the colors you found. 11998228 = 0xB71414 = B7-14-14, which is a medium large red value (183/255) and very low blue and green values (20/255), which makes a dark blood red.
Colors are in hex. If you look at a color editor, you see the colors broken up into rgb values, from 0 to 255 (in hex, 0 to FF). The coding takes the colors converted into hex numbers, the hex numbers are just converted to decimal. You can use 0x______ to not need a conversion. E.g. 0xFF0000 is bright red. Try it with any of the colors you found. 11998228 = 0xB71414 = B7-14-14, which is a medium large red value (183/255) and very low blue and green values (20/255), which makes a dark blood red.
After doing a little research on this myself, have a look here and here for converting hex to binary<RGB> color codes and it should work...
Just using 0x before your number should indicate a hex value. No conversion needed. Also, you'd want to convert to decimal (radix 10) not binary (radix 2).
Just using 0x before your number should indicate a hex value. No conversion needed. Also, you'd want to convert to decimal (radix 10) not binary (radix 2).
Yes but the numbers he is showing above are in binary form, and some of the code I have seen in EBXL also use binary, and I have tried using hex myself in the custom biomes for changing the color and that does not always work. I have had much success using RRGGBB binary form.
Yes but the numbers he is showing above are in binary form, and some of the code I have seen in EBXL also use binary, and I have tried using hex myself in the custom biomes for changing the color and that does not always work. I have had much success using RRGGBB binary form.
What do you mean by binary form? The only numeric context I've ever seen binary used in is in referring to the binary number system, and none of those numbers are expressed in binary. Also, when a color is expressed in rrggbb, the numbers are in hex, not binary.
I understand perfectly what you are saying, but if you go to the web pages I have linked above you will see I mean binary color form. The numbers the OP has posted above are in binary color format, not hex <0xFFFFFF>. I just tried using the 0xFFFFFF in my custom biome in MC 1.4.7 and it is not accepted at all, gives error and wants to change or create local variable...
edit....my mistake it should be a RRGGBB decimal, just remove the commas when pasting in the color code. But you should also bare in mind that the color code you choose is going to be applied to the base green of the grass. So the color you choose may not be the color you get.
I understand perfectly what you are saying, but if you go to the web pages I have linked above you will see I mean binary color form. The numbers the OP has posted above are in binary color format, not hex <0xFFFFFF>. I just tried using the 0xFFFFFF in my custom biome in MC 1.4.7 and it is not accepted at all, gives error and wants to change or create local variable...
edit....my mistake it should be a RRGGBB decimal, just remove the commas when pasting in the color code. But you should also bare in mind that the color code you choose is going to be applied to the base green of the grass. So the color you choose may not be the color you get.
If it asked to make a variable, then you've done something wrong, as java accepts hex numbers exactly as numbers, as long as they are prefaced with 0x.
I could be wrong, but I'm pretty sure it's applied to the gray texture, not the green one. It might be a bit off, but not radically different. Also, those aren't in binary at all. Binary color form looks like it's just the hex form broken into standard radix 2 binary bytes, which those aren't.
Also, if you opt to use decimal form, the number is converted from its hex and is not in the rrggbb format.
If it asked to make a variable, then you've done something wrong, as java accepts hex numbers exactly as numbers, as long as they are prefaced with 0x.
I could be wrong, but I'm pretty sure it's applied to the gray texture, not the green one. It might be a bit off, but not radically different. Also, those aren't in binary at all. Binary color form looks like it's just the hex form broken into standard radix 2 binary bytes, which those aren't.
Also, if you opt to use decimal form, the number is converted from its hex and is not in the rrggbb format.
Well as I have made numerous biomes and have attempted this many times.....instead of insinuating I am wrong, please....provide an example where this is wrong....
public int getBiomeGrassColor()
{
return 1963058;
}
Because I have tried many times to use the hex '0x' form but it never works, always get errors on this and none of the suggested fixes work either, as most of them are not for biome color. the other....public int getBiomeFoliageColor() works the exact same way....never accepts the '0x' hex number. So please show an example of how you would do this in 1.4.7, because 1.5.1 is the same way.....
Well as I have made numerous biomes and have attempted this many times.....instead of insinuating I am wrong, please....provide an example where this is wrong....
public int getBiomeGrassColor()
{
return 1963058;
}
Because I have tried many times to use the hex '0x' form but it never works, always get errors on this and none of the suggested fixes work either, as most of them are not for biome color. the other....public int getBiomeFoliageColor() works the exact same way....never accepts the '0x' hex number. So please show an example of how you would do this in 1.4.7, because 1.5.1 is the same way.....
Excuse the name, I don't have any mods that add biomes, so I just added a quick one.
public class Pointless extends BiomeGenBase
{
public Pointless(int par1)
{
super(par1);
}
@Override
public int getBiomeGrassColor()
{
return 0xFF00FF;
}
}
Antigreen, as expected from 255 red 0 green 255 blue.
Also, if one would like a reference for how the color will look, the following texture was done with a multiply layer of the grass color from the code on the grey grass texture.
How are the colors ignored? It just is the uncolored texture? Can you get it to work with decimal?
It works fine for me, but I use forge.
public void load(FMLInitializationEvent event)
{
////
registerEntityEgg(EntityRedGiantCreeper.class, 0xbb1111, 0xdd3333);
////
}
public static void registerEntityEgg(Class<? extends Entity> entity, int primaryColor, int secondaryColor)
{
int id = getUniqueEntityId();
EntityList.IDtoClassMapping.put(id, entity);
EntityList.entityEggs.put(id, new EntityEggInfo(id, primaryColor, secondaryColor));
}
No, it doesn't make a difference, it just uses the default creeper egg texture. The egg itself works just fine it's just the name and the colors. It says Spawn entity.Magician Pig.name
The 0x______ is used in place of the decimal. If the decimal doesn't work, something else is wrong. In forge, the name is fixed by just localizing the string. I don't know how it's done in ModLoader(maybe look through the addName method) but in forge it's
yeah I localized the name with ModLoader.addLocalization("entity.Magician Pig.name", "Magician Pig");
but then the egg color method is ignored, I tried decimal:
ModLoader.registerEntityID(EntityPigU.class, "Magician Pig", 30, 16600000, 16400010);
I'm trying to add a prairie biome, with yellow colored grass. However, I don't know the right code or how they work.
What I want it to look like:
http://en.wikipedia.org/wiki/Prairie
The closest I've come:
Colors found so far:
1500000 = green/aqua
16000000 = bright red
16500000 = gold
16600000 = pink/purple
16400010 = pink
1650000 = navy blue
17000000 = dark green
17500000 = blue
18000000 = turquoise
10000000 = grey
96500000 = orange
15820061 = red/orange
11998228 = blood red
If anyone could explain either how the colors work, or find the color that I need, I would appreciate it.
Just in case you haven't had exposure to other number bases:http://www.purplemath.com/modules/numbbase.htm
Thanks, I'll see how that goes.
Find out how I generate....coolAlias...world structure generation and rotation tool...
Just using 0x before your number should indicate a hex value. No conversion needed. Also, you'd want to convert to decimal (radix 10) not binary (radix 2).
Yes but the numbers he is showing above are in binary form, and some of the code I have seen in EBXL also use binary, and I have tried using hex myself in the custom biomes for changing the color and that does not always work. I have had much success using RRGGBB binary form.
Find out how I generate....coolAlias...world structure generation and rotation tool...
What do you mean by binary form? The only numeric context I've ever seen binary used in is in referring to the binary number system, and none of those numbers are expressed in binary. Also, when a color is expressed in rrggbb, the numbers are in hex, not binary.
edit....my mistake it should be a RRGGBB decimal, just remove the commas when pasting in the color code. But you should also bare in mind that the color code you choose is going to be applied to the base green of the grass. So the color you choose may not be the color you get.
Find out how I generate....coolAlias...world structure generation and rotation tool...
If it asked to make a variable, then you've done something wrong, as java accepts hex numbers exactly as numbers, as long as they are prefaced with 0x.
I could be wrong, but I'm pretty sure it's applied to the gray texture, not the green one. It might be a bit off, but not radically different. Also, those aren't in binary at all. Binary color form looks like it's just the hex form broken into standard radix 2 binary bytes, which those aren't.
Also, if you opt to use decimal form, the number is converted from its hex and is not in the rrggbb format.
Well as I have made numerous biomes and have attempted this many times.....instead of insinuating I am wrong, please....provide an example where this is wrong....
Because I have tried many times to use the hex '0x' form but it never works, always get errors on this and none of the suggested fixes work either, as most of them are not for biome color. the other....public int getBiomeFoliageColor() works the exact same way....never accepts the '0x' hex number. So please show an example of how you would do this in 1.4.7, because 1.5.1 is the same way.....
Find out how I generate....coolAlias...world structure generation and rotation tool...
Excuse the name, I don't have any mods that add biomes, so I just added a quick one.
Antigreen, as expected from 255 red 0 green 255 blue.
Also, if one would like a reference for how the color will look, the following texture was done with a multiply layer of the grass color from the code on the grey grass texture.
You can either convert to decimal or put 0x before the hex color.
EDIT: To resolve whether it has a bit of green in it, this is the colour for 0xFFFFFF
ModLoader.registerEntityID(EntityPigU.class, "Magician Pig", 30, 0xE56E94, 0x7E587E);//registers the mobs name and id
Any suggestions? Sorry for bumping.
It works fine for me, but I use forge.
but then the egg color method is ignored, I tried decimal:
ModLoader.registerEntityID(EntityPigU.class, "Magician Pig", 30, 16600000, 16400010);