Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2008

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

Search the Archive

Re: How do I create my own color gradient?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg92544] Re: How do I create my own color gradient?
  • From: Tyler <hayes.tyler at gmail.com>
  • Date: Sat, 4 Oct 2008 06:16:41 -0400 (EDT)
  • References: <gc3j51$sah$1@smc.vnet.net> <gc4suu$f2l$1@smc.vnet.net>

Thanks for the tips everyone! Looks like I have a full weekend ahead
playing with ColorFunctions and Blend....

Cheers,

t.

PS - I never thought to try FullForm on ColorData...nice trick :)

On Oct 3, 6:42 am, Szabolcs Horv=E1t <szhor... at gmail.com> wrote:
> Tyler wrote:
> > Hi All:
>
> > Kinda of a silly question, but I've been banging head against the wall
> > for the past two nights. I am trying to figure out how I can make my
> > own colour gradient, analogous to Rainbow, AplineColors, &c.
>
> > Is there any standard framework around trying to create your own?
> > Further, say I wanted one of the preexisting ones, but scaled
> > exponentially, or set a particular value to bright yellow (to
> > highlight that specific result). I used to use IDL quite a bit, and
> > made use of these kinds of manipulations frequently.
>
> > Any ideas or references? I keep finding myself doing the same old loop
> > in the Documentation Center, from ColorData, to ColorFunction, and so
> > on, and so on.....
>
> Some examples:
>
> cbar[cfun_] :=
>   DensityPlot[x, {x, 0, 1}, {y, 0, 1}, AspectRatio -> 1/7,
>    Frame -> False, ColorFunction -> cfun]
>
> A built-in gradient:
>
> cbar["Rainbow"]
>
> Custom gradient:
>
> cbar[Blend[{Red, Green, Blue}, #] &]
>
> Built-in gradient transformed with a power function:
>
> cbar[ColorData["Rainbow"][#^4] &]



  • Prev by Date: Re: could not get Simplified form
  • Next by Date: Re: Plotting ListDensityPlot with Custom Color Scheme
  • Previous by thread: Re: How do I create my own color gradient?
  • Next by thread: Re: how to get rid of extra parentheses ?