Jump to content

Retrieving a model's colours


Purity

Recommended Posts

Using the OSBot API; how could I retrieve the colours of an entity's model, such as an NPC?
 
I've tried using methods getModifiedModelColors() and getOriginalModelColors() of the EntityDefinition class, which return small arrays of 16 bit integers.

I'm not entirely sure how to interpret these values, I'm guessing they represent indices in Runescapes colour palette, as they couldn't possibly represent a 24 bit colour-depth value. In any case, the arrays don't contain enough values for each face on the model, so there must be something I'm missing.

 

If you could clear this up for me, it would be much appreciated.

 

Link to comment
Share on other sites

Using the OSBot API; how could I retrieve the colours of an entity's model, such as an NPC?

 

I've tried using methods getModifiedModelColors() and getOriginalModelColors() of the EntityDefinition class, which return small arrays of 16 bit integers.

I'm not entirely sure how to interpret these values, I'm guessing they represent indices in Runescapes colour palette, as they couldn't possibly represent a 24 bit colour-depth value. In any case, the arrays don't contain enough values for each face on the model, so there must be something I'm missing.

 

If you could clear this up for me, it would be much appreciated.

before i say anything useful, i'd like to mention that my ballsack is huge.

    private Color getJagexColor(final int jag) {
        return new Color(jag >> 16 & 0xff, jag >> 8 & 0xff, jag & 0xff);
    }
w0w why cant i lyk my own p0st

can convert a java.awt.Color to a jagex color too, by shifting left r, g, b and adding them up

Edited by dog_
  • Like 1
Link to comment
Share on other sites

before i say anything useful, i'd like to mention that my ballsack is huge.

    private Color getJagexColor(final int jag) {
        return new Color(jag >> 16 & 0xff, jag >> 8 & 0xff, jag & 0xff);
    }
w0w why cant i lyk my own p0st

can convert a java.awt.Color to a jagex color too, by shifting left r, g, b and adding them up

 

 

I'm sorry if there's something I'm missing here, but the given values are short Integers.

 

If I was to bit-shift a short integer 16 places to the right, wouldn't that be a guaranteed 0x00 value?

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...