Pink led is not pink (solved)

Hey, so I am making a Led that responds to my gestures.
swiping left turns it on, right off
and up and down change the color
when I come to my third color it should be pink (when I test just that color it is pink). However it turns up as a less bright blue(I added the clockwise part to just test the third color):

//include the gesture library
#include <Wire.h>
#include "paj7620.h"

//include the NeoPixel library
#include "Adafruit_NeoPixel.h"
#ifdef __AVR__
#include <avr/power.h>
#endif


// Define the pin on which the led is connected
#define PIN            6

// Define the number of led-lights
#define NUMPIXELS      30

// Setup for the NeoPixel
Adafruit_NeoPixel pixels = Adafruit_NeoPixel(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);
// set the delay to change 30 lights within a second, this is purely for aesthetical reasons
int delayval = 33; 

//put the different colors to use in an array
int colors[] = {
 0xffffff, 0xf7a01e, 0xfa19dc, 0x1140fa, 0x0afa2a
};

//initialize a value used to pick one out of colors
int x = 0;
//checks whether or not the led is on
boolean Ledon = false;

void setup() {
 // load the gestures
 paj7620Init();


 // Set the pixel brightness to max as starting value
 pixels.setBrightness(255);
 pixels.begin(); //Initialize the NeoPixel library.
}


void loop() {

 uint8_t data = 0;  // Read Bank_0_Reg_0x43/0x44 for gesture result.

 paj7620ReadReg(0x43, 1, &data);  // When different gestures be detected, the variable 'data' will be set to different values by paj7620ReadReg(0x43, 1, &data).

 //When the left gesture is detected put the led strip on
 if (data == GES_LEFT_FLAG) {
   for (int i = 0; i < NUMPIXELS; i++) {
     pixels.setPixelColor(i, colors[x]); //Turn the Led on

     pixels.show(); // This sends the updated pixel color to the hardware.

     delay(delayval); // Delay for a period of time (in milliseconds).
   }
   Ledon = true;
 }
 
 //When the Right gesture is detected
 if (data == GES_RIGHT_FLAG)  {
   for (int i = 0; i < NUMPIXELS; i++) {
     pixels.setPixelColor(i, pixels.Color(0, 0, 0)); //turn the Led off

     pixels.show();

     delay(delayval);
   }
   x = 0;
   Ledon = false;
 }
 
 // if the led is on, use the up and down gestures to change the colors
 if (Ledon == true) {
   
   //use the up gesture to go to the next color
   if (data == GES_UP_FLAG) {
     //Increase x with one to go to the next color
     x += 1;
     //Loop the colors around when x exceeds the Color array
     if ( x > 4) {
       x = 0;
     }
     //display the next color
     for (int i = 0; i < NUMPIXELS; i++) {
       pixels.setPixelColor(i, colors[x]);

       pixels.show(); 

       delay(delayval);
     }
   }
   
   //use the down gesture to go to the previous color
   if (data == GES_DOWN_FLAG) {
     //Decrease x with one to go to the previous color
     x -= 1;
     //Loop the colors around when x recedes 0
     if (x < 0) {
       x = 4;
     }
     for (int i = 0; i < NUMPIXELS; i++) {
       pixels.setPixelColor(i, colors[x]);

       pixels.show();

       delay(delayval);
     }
   }
 if (data == GES_CLOCKWISE_FLAG) {
     
     x = 2;
     for (int i = 0; i < NUMPIXELS; i++) {
       pixels.setPixelColor(i, colors[x]);

       pixels.show();

       delay(delayval);
     }
   }
   
 }
}

I hope someone can help me.

Start by editing your post and putting the code in code tags so that it is readable

Sorry, I am kind of new to this. Is this better?

pink LED using the Adafruit_NeoPixel.h, I get, leds.setPixelColor(position, leds.Color( value, 0, value * .91) ); // pink. What I get is a brightening/dimming pink color in relation to the value given.

Whiles you may set brightness to the max, the LED intensity is based upon the intensity level set in leds.setPixelColor. So the ratio, to get pink is red=value, green=0, and blue = value *.91 and hwre value is the intensity of a color to be displayed.

what arduino do you have?

on "small" arduino, an int is 2 bytes and you try to stick 3 bytes in them, so you'll loose information

int colors[] = { 0xffffff, 0xf7a01e, 0xfa19dc, 0x1140fa, 0x0afa2a};

use instead

const uint32_t colors[] = { 0xffffff, 0xf7a01e, 0xfa19dc, 0x1140fa, 0x0afa2a};

Thanks a million, it works now and I understand whats going on. :smiley:

great! have fun