You are here

function socialcalc_cellformat_parsecolor in Sheetnode 7.2

Same name and namespace in other branches
  1. 5 socialcalc.inc \socialcalc_cellformat_parsecolor()
  2. 6 socialcalc.inc \socialcalc_cellformat_parsecolor()
  3. 7 socialcalc.inc \socialcalc_cellformat_parsecolor()
1 call to socialcalc_cellformat_parsecolor()
_sheetnode_phpexcel_export_sheet in modules/sheetnode_phpexcel/sheetnode_phpexcel.export.inc
Helper function to export a single spreadsheet.

File

./socialcalc.inc, line 963
SocialCalc manipulation functions.

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;
}