public void setColor ( int n , int color ) { int firstColor = map [ 0 ] ; int lastColor = map [ 256 - 1 ] ; if ( n > 0 ) for ( int i = 0 ; i < n ; i ++ ) map [ i ] = ImageMath . mixColors ( ( float ) i / n , firstColor , color ) ; if ( n < 256 - 1 ) for ( int i = n ; i < 256 ; i ++ ) map [ i ] = ImageMath . mixColors ( ( float ) ( i - n ) / ( 256 - n ) , color , lastColor ) ; }
Set a knot color .