It wants 3 separate args.. If you just try to enter a string such as "0,122,255", you are only supplying one arg. You either need to use eval() (which is non-optimal, in my opinion):
$color = "0,122,255";
eval('$cols->SetTextColor('.$color.');');
Use 3 variables:
$red = 0;
$green = 122;
$blue = 255;
$cols->SetTextColor($red, $green, $blue);
Or else extend the class to allow entering a, string, e.g.:
class MyFPDF extends FPDF
{
function MySetTextColor($color)
{
$colors = explode(',', $color);
if(count($colors != 3)
{
user_error("invalid parameter '$color'");
return false;
}
$this->SetTextColor((int)$rgb[0], (int)$rgb[1], (int)$rgb[2]);
return true;
}
}
// sample usage:
$fpdf = new MyFPDF();
$colors = "0,122,255";
$fpdf->MySetTextColor($colors);