1 18 19 package org.apache.jmeter.util; 20 21 import java.awt.Color ; 22 23 30 public final class ColorHelper 31 { 32 35 private ColorHelper() 36 { 37 } 38 39 48 public static Color changeColorCyclicIncrement(Color col, int inc) 49 { 50 int red = col.getRed(); 51 int green = col.getGreen(); 52 int blue = col.getBlue(); 53 int temp1 = Math.min(red, green); 54 int temp2 = Math.min(temp1, blue); 55 if (red == temp2) 57 { 58 red += inc; 59 red %= 256; 60 } 61 else if (green == temp2) 62 { 63 green += inc; 64 green %= 256; 65 } 66 else if (blue == temp2) 67 { 68 blue += inc; 69 blue %= 256; 70 } 71 return new Color (red, green, blue); 72 } 73 } 74 | Popular Tags |