public static Color [ ] redblue ( int n , float alpha ) { Color [ ] palette = new Color [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { palette [ i ] = new Color ( ( float ) Math . sqrt ( ( i + 1.0f ) / n ) , 0.0f , ( float ) Math . sqrt ( 1 - ( i + 1.0f ) / n ) , alpha ) ; } return palette ; }
Generate red - blue color palette .