MathGroup Archive 2011

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Is it possible to define new color schemes?


If you happen to know an analytic form that connect a parameter running 
between 0 and 1 and the value of your RGB channels you can do something 
like this:

phasecolor[x_] := RGBColor[-Cos[x/2] + 1, (-Cos[(\[Pi] + x)^2/(2 \[Pi])] 
+ 1)/
    2, (-Cos[(\[Pi] - x)^2/(2 \[Pi])] + 1)/2];
DensityPlot[Cos[x y], {x, -5, 5}, {y, -5, 5}, ColorFunction -> phasecolor]

Best

Jacopo

On 11/21/2011 10:28 AM, Darau, M. wrote:
> Hello,
>
> Is it possible to define a new gradient color scheme to use in DensityPlot? If so, how can I do that? I know the RGB of the end colors, and maybe 2-3 intermediate ones.
>
> Thanks,
> Mirela
>
>




  • Prev by Date: Re: What is the point of having Initializations in DynamicModule and Manipulate?
  • Next by Date: Re: Elliptical gear calculations
  • Previous by thread: Re: Is it possible to define new color schemes?
  • Next by thread: Loop problem