int (int red, int green, int blue, int alpha) { Vector vector = myMatrix.getRows() == 4 ? Vector.create(red, green, blue, alpha) : Vector.create(red, green, blue); Vector result = vector.multiply(myMatrix); if (myWeight != null) { if (vector.getSize() != result.getSize()) { vector = result.getSize() == 4 ? Vector.create(red, green, blue, alpha) : Vector.create(red, green, blue); } vector = vector.multiply(1 - myWeight); result = result.multiply(myWeight).plus(vector); } red = (int)result.get(0); green = (int)result.get(1); blue = (int)result.get(2); if (result.getSize() == 4) { alpha = (int)result.get(3); } return super.convert(red, green, blue, alpha); }