Q: Finding a color in a column and getting the data from another column I have an spreadsheet like the following.
      A             B             C
7- Test                       [red]
8- Test1                      [yellow]
9- Test2                      [red] 

So, I'm trying to pass a loop in the column C, starting on C7. When it gets the color red, I should be able to get the values from column A, which are Test and Text2.
Here is the related code (it's not entering on the if)
SpreadsheetApp.getUi()   
var s = SpreadsheetApp.getActiveSheet();

var dataCor = s.getRange('C7:C').getBackgrounds();
Browser.msgBox(dataCor);                      //Here I show the codes from the colors.
var dataValor = s.getRange('A7:A').getValues();
Browser.msgBox(dataValor);                   //Here I show the values from the column A.

var list = [];
var n = 0;
var n2 = 0;

for(var i = 0; i < dataCor.length; i++)
{
 n = n + 1;

 if(dataCor == '#cc0000') 
 {  
  list[n2] = s.getRange('A7'+n-1).getValue();
  n2++;
 }
}  
Browser.msgBox(list);

PS: If you guys have any suggestions, please tell me.
PS1: Just to knowledge, is there any function that ignores the weekend days on a math? For example, if I get the date 22 of february, I know that 20 and 21 should be ignored so people would be able to work from 15 to 19. Anyway, it's not related to the topic.

A: I agreed to @serge-insas,
rather than going through two arrays for background and value, we can use same range. Just a thought
function getValueByColor()
{
var s = SpreadsheetApp.getActiveSheet();
var myRange = s.getRange('A7:C');
var list = [];

for (var i = 1; i <= myRange.getNumRows(); i++) 
{
  // 3 -column c : 
  if(myRange.getCell(i,3).getBackground() == '#cc0000')
  {
    //1- column A
    list.push(myRange.getCell(i,1).getValue())
  }
}
//debugger;
Browser.msgBox(list);
}


A: The arrays you get from your getValues() statements are 2D arrays, in other words, arrays of arrays.
In you Logger you should see something like that : [[xx],[yy],[zz],...]
so your comparison should compare the content of the array at the desired index and not - as you did - the entire 2D array.
In your script replace 
if(dataCor == '#cc0000')

with
if(dataCor[n][0] == '#cc0000')
and similarly when you add the result to the output list :
list[n2] = dataValue[n]

which I would replace be using the array.push method
list.push(dataValue[n])

And in the end, when you get your list array write it in one single step to your sheet column using something like 
s.getRange(1,1,list.length,list[0].length).setValues(list)


EDIT
Following iJay's answer which is using spreadsheet service calls in the loop (which is a bad idea because it is very slow - see best practices here- )
here is his code modified for a better efficiency ;
function getValueByColor(){
   var s = SpreadsheetApp.getActiveSheet();
   var myRangeValues = s.getRange('A7:C').getValues();
   var myRangeColors = s.getRange('A7:C').getBackgrounds();
   Logger.log(myRangeColors)
   var list = [];
   for (var i = 0; i < myRangeValues.length; i++) {
      if(myRangeColors[i][2] == '#cc0000'){ // idx 2 is 3rd column = C
       list.push([myRangeValues[i][0]]) // grab value in column A
     }
   }
   Browser.msgBox(list);
 }


Edit 2
To get col A and B in the result list simply change this line :
list.push(myRangeValues[i][0]+' | '+myRangeValues[i][1] ) // grab value in column A and B

note : since Browser.msgBox does not handle "new line" I'd suggest using HTML to show it the way you want.
Code :
   ...   
   var list = '';
   for (var i = 0; i < myRangeValues.length; i++) {
      if(myRangeColors[i][2] !== '#cc0000'){ // idx 2 is 3rd column = C
       list+=myRangeValues[i][0]+' | '+myRangeValues[i][1] +'<br>' // grab value in column A and B
     }
   }
  var result= HtmlService.createHtmlOutput(list)
   SpreadsheetApp.getUi().showModalDialog(result, 'result')
 }

