problem with TCS320

I want control a servo with a TCS320 when tcs recognize red color servo must stop… but my code not working any help would be appreciated

#include <Servo.h>
#define s0 0
#define s1 1
#define s2 2
#define s3 3
#define Out 4
int LED = 7;
int frequency = 0;
int color = 0;
int red=0;
Servo myServo;

void setup() {
  pinMode(s0, OUTPUT);
  pinMode(s1, OUTPUT);
  pinMode(s2, OUTPUT);
  pinMode(s3, OUTPUT);
  pinMode(Out, INPUT);
  pinMode(LED, OUTPUT);
  digitalWrite(s0, HIGH);
  digitalWrite(s1, LOW);
  myServo.attach(11);
  Serial.begin(9600);
}

void loop() {
  myServo.write(180);
  delay(500);
  color = readColor();
  delay(10);  
  switch (color) {
    case 1:
    myServo.write(90);
    digitalWrite(LED,HIGH);
    myServo.detach(11);
    break;
    default:
    myServo.write(25);
    break;
  }
  delay(300);
 
}
// Custom Function - readColor()
int readColor() {
  // Setting red filtered photodiodes to be read
  digitalWrite(s2, LOW);
  digitalWrite(s3, LOW);
  // Reading the output frequency
  frequency = pulseIn(Out, LOW);
  int R = frequency;
  // Printing the value on the serial monitor
  Serial.print("R= ");//printing name
  Serial.print(frequency);//printing RED color frequency
  Serial.print("  ");
  delay(40);
  // Setting Green filtered photodiodes to be read
  digitalWrite(s2, HIGH);
  digitalWrite(s3, HIGH);
  // Reading the output frequency
  frequency = pulseIn(Out, LOW);
  int G = frequency;
  // Printing the value on the serial monitor
  Serial.print("G= ");//printing name
  Serial.print(frequency);//printing RED color frequency
  Serial.print("  ");
  delay(40);
  // Setting Blue filtered photodiodes to be read
  digitalWrite(s2, LOW);
  digitalWrite(s3, HIGH);
  // Reading the output frequency
  frequency = pulseIn(Out, LOW);
  int B = frequency;
  // Printing the value on the serial monitor
  Serial.print("B= ");//printing name
  Serial.print(frequency);//printing RED color frequency
  Serial.println("  ");
  delay(40);
  if (R<45 & R>32 & G<65 & G>55) {
    color = 1; // Red
  }
}