The following document contains the results of PMD's CPD 4.2.5.
| File | Line |
|---|---|
| nl/tudelft/goal/ut2004/visualizer/map/MapColorGenerator.java | 59 |
| nl/tudelft/goal/ut2004/visualizer/map/TeamShade.java | 56 |
}
}
/**
* Create a mixed color from passed color and this color in following
* fashion:
*
* <pre>
* this * (1 - portion) + mixing * portion
* </pre>
*
* @param mixing
* Color that will be mixed with this one.
* @param portion
* how much of mixing color will be used
* @return Mixed color, not that this color won't be changed
*/
private Color mix(Color a, Color b, double portion) {
double thisPortion = 1 - portion;
return new Color(
// Red
(int) (thisPortion * a.getRed()) + (int) (portion * b.getRed()),
// Green
(int) (thisPortion * a.getGreen()) + (int) (portion * b.getGreen()),
// Blue
(int) (thisPortion * a.getBlue()) + (int) (portion * b.getBlue()),
// Alpha
(int) (thisPortion * a.getAlpha()) + (int) (portion * b.getAlpha()));
} | |