Accelerometer and neopixels code

I'm looking for some coding guidance. The goal is to have neopixels respond in a color change through input from an accelerometer.

Board: Flora
Neopixels: Flora RGB Smart NeoPixel version 2
Accelerometer: FLORA Accelerometer/Compass Sensor - LSM303

The tests code for the accelerometer and neopixels both work great. I've garnered the values I want to work between with the accelerometer (just x-axis for now).

QUESTION: How can you assign the input values from the accelerometer to the neopixel color? to blend the colors like the "rainbow" or "color wipe"?

For instance, say the input is 0 to 600 where I want 0 = red, 100 = orange, 200 = yellow....etc... till 600 = purple...but all to blend? Thoughts?

Thank you ahead for any help

Look for a function that translates between HLS and RGB color models. HLS is Hue/Lightness/Saturation and makes it easy to pick a color (Hue) separate from the Lightness (from dark to light) and Saturation (from pastel to vivid). Map your input numbers to Hue and keep Lightness and Saturation up full. Convert to RGB and send the RGB values to the pixels.

Johnwasser,
That was well said, clear and very helpful...
Let me tinker with it and will post some code
Many thanks!

Did you have any luck with the coding?
I'm trying to do almost the same thing.

Here's one with basic movement....without any ratios.

I've found the following library easy to work with:

Not sure exactly what you are looking for but this has tones of examples to use

void rainbowChange()
{
  // FastLED's built-in rainbow generator
  fill_rainbow( leds, NUM_LEDS, gHue, 7);
  EVERY_N_MILLISECONDS( 20 ) {
    gHue++;  // slowly cycle the "base color" through the rainbow
  }
}

you could use something like this but have the gHue change depending on accelerometer gravity reading the rainbow would shift back and forth

look in the examples for all the code associated with this function