MathGroup Archive 2011

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

Search the Archive

Re: Is it possible to define new color schemes?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg123079] Re: Is it possible to define new color schemes?
  • From: Jacopo Bertolotti <jacopo.bertolotti at gmail.com>
  • Date: Tue, 22 Nov 2011 07:23:29 -0500 (EST)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • References: <201111210928.EAA14782@smc.vnet.net>

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