Search in sources :

Example 1 with Colour

use of codechicken.lib.colour.Colour in project Galacticraft by micdoodle8.

the class TextureUtils method loadTextureColours.

public static Colour[] loadTextureColours(ResourceLocation resource) {
    int[] idata = loadTextureData(resource);
    Colour[] data = new Colour[idata.length];
    for (int i = 0; i < data.length; i++) {
        data[i] = new ColourARGB(idata[i]);
    }
    return data;
}
Also used : ColourARGB(codechicken.lib.colour.ColourARGB) Colour(codechicken.lib.colour.Colour)

Example 2 with Colour

use of codechicken.lib.colour.Colour in project GregTech by GregTechCE.

the class FacadeRenderer method applyItemTint.

public static List<CCQuad> applyItemTint(List<CCQuad> quads, ItemStack stack) {
    List<CCQuad> retQuads = new LinkedList<>();
    for (CCQuad quad : quads) {
        int colour = -1;
        if (quad.hasTint()) {
            colour = Minecraft.getMinecraft().getItemColors().colorMultiplier(stack, quad.tintIndex);
            if (EntityRenderer.anaglyphEnable) {
                colour = TextureUtil.anaglyphColor(colour);
            }
            colour = colour | 0xFF000000;
        }
        CCQuad copyQuad = quad.copy();
        Colour c = new ColourARGB(colour);
        for (Colour qC : copyQuad.colours) {
            qC.multiply(c);
        }
        retQuads.add(copyQuad);
    }
    return retQuads;
}
Also used : ColourARGB(codechicken.lib.colour.ColourARGB) CCQuad(codechicken.lib.render.CCQuad) LinkedList(java.util.LinkedList) Colour(codechicken.lib.colour.Colour)

Aggregations

Colour (codechicken.lib.colour.Colour)2 ColourARGB (codechicken.lib.colour.ColourARGB)2 CCQuad (codechicken.lib.render.CCQuad)1 LinkedList (java.util.LinkedList)1