0

I am exporting excel for bulk upload in PHP laravel. I am applying color to cell applying the following method:-

    public function styles(Worksheet $sheet)
    {
        return [
            'A1'  => [
                'fill' => [
                    'fillType' => Fill::FILL_SOLID,
                    'startColor' => [
                        'rgb' => '#fa7b3e'
                    ]
                ]
            ]
        ];
    }

when I open exported excel in google sheet it worked fine but when opened in Microsoft office it shows only black color where this color applied.

when I apply 'argb' => 'FFFF0000' instead of 'rgb' => '#fa7b3e' it is working fine in Microsoft office.

please, give me some link or solution to this problem. I can't able to find argb color code like this FFFF0000 online. I found this rgba code rgba(250, 123, 62, 1)

Kishan
  • 13
  • 8
  • try with this solution: https://stackoverflow.com/questions/57384209/how-to-set-background-color-for-row-in-laravel-excel – Naveed Ali Aug 29 '20 at 11:12

1 Answers1

-1

You cant apply hex to rgb, you need to convert it first.

you can use any colorpicker and configure it for rgb or use w3schools script

Here is another answer for this: https://stackoverflow.com/a/40280985/477902

flakerimi
  • 2,580
  • 3
  • 29
  • 49