Color changing RGB based on number of emails

Im hoping someone could point me in the right direction.

First off I’m new here and very excited to be learning to code my arduino!

The project I would like to work on is simple in concept but I don’t quite know where to begin. I would like to have an ambient light device that sits on my desk at work and changes color based on the amount of emails we have in our customer support inbox, i.e. it would be blue when our inbox is empty and would move through the spectrum to red as our email inbox gets close to 1000. Something like that.

We use Desk as our email client.

If anyone has seen something similar or could give me a jump off point it would be much appreciated. I don’t mind googling I just am not sure what approach to take.

If you email server supports non-SSL POP3 it would be pretty easy to write some code that does the initial POP3 login; this will return how many emails are in your inbox. Here's some more info:

Do you want the Arduino to be standalone and talk to your server via Ethernet, or do you want the work done on a PC and something to relay that to the Arduino via the USB/Serial link?

I think I'd like the PC to do the work for now, saves me from buying the ethernet shield for now. I'll read though your link. Thanks!

I did some rainbow testing last year. The rainbow is easiest expressed in HSL color space, this test app calculates the appropiate RGB values for it.

not tested recently, but should get you started. Better read wikipedia about colorspaces RGB and HSL too

//
//    FILE: RGB2HUE.pde
//  AUTHOR: Rob Tillaart
//    DATE: 2011-09-17 
//
// PUPROSE: color-rainbow
//
// http://www.dipzo.com/wordpress/?p=50
// http://www.easyrgb.com/index.php?X=MATH
//

int Rpin=10;
int Gpin=9;
int Bpin=11;

float H,S,L, Rval,Gval,Bval;

void HSL(float H, float S, float L, float& Rval, float& Gval, float& Bval);
float Hue_2_RGB( float v1, float v2, float vH );

void setup()
{
  Serial.begin(9600);

  pinMode(12, OUTPUT); 
}


void loop()
{
  S=1;
  L=.5;
  Rval=0;
  Gval=0;
  Bval=0;
  for (int i = 0; i< 360; i++)
  {
    HSL(i/360.0,S,L,Rval,Gval,Bval);

    //common anode configuration
    //analogWrite(Rpin, 255-Rval);
    //analogWrite(Gpin, 255-Gval);
    //analogWrite(Bpin, 255-Bval);
    //digitalWrite(12,HIGH);

    //common cathode configuration
    analogWrite(Rpin, Rval);
    analogWrite(Gpin, Gval);
    analogWrite(Bpin, Bval);
    digitalWrite(12,LOW);

    //print statements for debug
    Serial.print("position:");
    Serial.print(H);
    Serial.print(" R:");
    Serial.print(Rval);
    Serial.print(" G:");
    Serial.print(Gval);
    Serial.print(" B:");
    Serial.println(Bval);
    delay(100);
  }
}

void HSL(float H, float S, float L, float& Rval, float& Gval, float& Bval)
{
  float var_1;
  float var_2;
  float Hu=H+.33;
  float Hd=H-.33;
  if ( S == 0 )                       //HSL from 0 to 1
  {
    Rval = L * 255;                      //RGB results from 0 to 255
    Gval = L * 255;
    Bval = L * 255;
  }
  else
  {
    if ( L < 0.5 ) 
      var_2 = L * ( 1 + S );
    else           
      var_2 = ( L + S ) - ( S * L );

    var_1 = 2 * L - var_2;

    Rval = round(255 * Hue_2_RGB( var_1, var_2, Hu ));
    Serial.print("Rval:");
    Serial.println(Hue_2_RGB( var_1, var_2, Hu ));
    Gval = round(255 * Hue_2_RGB( var_1, var_2, H ));
    Bval = round(255 * Hue_2_RGB( var_1, var_2, Hd ));
  }

}
float Hue_2_RGB( float v1, float v2, float vH )             //Function Hue_2_RGB
{
  if ( vH < 0 ) 
    vH += 1;
  if ( vH > 1 ) 
    vH -= 1;
  if ( ( 6 * vH ) < 1 ) 
    return ( v1 + ( v2 - v1 ) * 6 * vH );
  if ( ( 2 * vH ) < 1 ) 
    return ( v2 );
  if ( ( 3 * vH ) < 2 ) 
    return ( v1 + ( v2 - v1 ) * (.66-vH) * 6 );
  return ( v1 );
}

Wow, thanks!