(String attribute, int wide, int high)
| 211 | |
| 212 | |
| 213 | static private Image makeGradientRGB(String attribute, int wide, int high) { |
| 214 | int top = getColor(attribute + ".gradient.top").getRGB(); |
| 215 | int bot = getColor(attribute + ".gradient.bottom").getRGB(); |
| 216 | |
| 217 | BufferedImage outgoing = |
| 218 | new BufferedImage(wide, high, BufferedImage.TYPE_INT_RGB); |
| 219 | int[] row = new int[wide]; |
| 220 | WritableRaster wr = outgoing.getRaster(); |
| 221 | for (int i = 0; i < high; i++) { |
| 222 | int rgb = PApplet.lerpColor(top, bot, i / (float)(high-1), PConstants.RGB); |
| 223 | Arrays.fill(row, rgb); |
| 224 | wr.setDataElements(0, i, wide, 1, row); |
| 225 | } |
| 226 | return outgoing; |
| 227 | } |
| 228 | |
| 229 | |
| 230 | static private Image makeGradientLab(String attribute, int wide, int high) { |
no test coverage detected