private Color variate ( Color color ) { assert color != null ; final int diff = 30 ; // darken the color for value of diff int newRed = shiftColorPart ( color . getRed ( ) - diff ) ; int newGreen = shiftColorPart ( color . getGreen ( ) - diff ) ; int newBlue = shiftColorPart ( color . getBlue ( ) - diff ) ; Color newColor = new Color ( newRed , newGreen , newBlue ) ; // start at the original section color again if darkening accidentally // resulted in black, which has already the meaning of section caves. if ( newColor . equals ( Color . black ) ) { newColor = colorMap . get ( SECTION_START ) ; } return newColor ; }
Shift the given section color one step .