function socialcalc_cellformat_parsecolor in Sheetnode 5        
                          
                  
                        Same name and namespace in other branches
- 6 socialcalc.inc \socialcalc_cellformat_parsecolor()
- 7.2 socialcalc.inc \socialcalc_cellformat_parsecolor()
- 7 socialcalc.inc \socialcalc_cellformat_parsecolor()
1 call to socialcalc_cellformat_parsecolor()
  - _sheetnode_phpexcel_export_do in modules/sheetnode_phpexcel/sheetnode_phpexcel.export.inc
File
 
   - ./socialcalc.inc, line 678
- SocialCalc manipulation functions
Translated from socialcalc-3.js and companion files
Code
function socialcalc_cellformat_parsecolor($cell, $sheet, $color) {
  if (empty($cell[$color])) {
    return FALSE;
  }
  $parts = array();
  preg_match('/^rgb\\((\\d+?),\\s*(\\d+?),\\s*(\\d+?)\\)\\s*$/', $sheet['colors'][$cell[$color]], $parts);
  $rgb = array(
    'r' => intval($parts[1]),
    'g' => intval($parts[2]),
    'b' => intval($parts[3]),
  );
  return $rgb;
}