You are here

private function lessc::compileColor in Less CSS Preprocessor 6

1 call to lessc::compileColor()
lessc::compileValue in ./lessc.inc.php

File

./lessc.inc.php, line 838

Class

lessc

Code

private function compileColor($c) {
  if (count($c) == 5) {

    // rgba
    return 'rgba(' . $c[1] . ',' . $c[2] . ',' . $c[3] . ',' . $c[4] . ')';
  }
  $out = '#';
  foreach (range(1, 3) as $i) {
    $out .= ($c[$i] < 16 ? '0' : '') . dechex($c[$i]);
  }
  return $out;
}