0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

PhpSpreadsheetで配色を指定する方法

Last updated at Posted at 2023-08-09

はじめに

覚書程度に。配色を指定する方法を探したがなかったので。

変更するファイル

phpoffice\phpspreadsheet\src\PhpSpreadsheet\Writer\Xlsx\Theme.php
96行目の$colourSchemeを変更する

変更内容

Hexをテーマに合わせて変更する。デフォルトはOffice2007-2010になっている

Theme.php
    private static $colourScheme = [
        'dk2' => '1F497D',
        'lt2' => 'EEECE1',
        'accent1' => '4F81BD',
        'accent2' => 'C0504D',
        'accent3' => '9BBB59',
        'accent4' => '8064A2',
        'accent5' => '4BACC6',
        'accent6' => 'F79646',
        'hlink' => '0000FF',
        'folHlink' => '800080',
    ];

・Office

name hex
dk2 44546A
lt2 E7E6E6
accent1 4472C4
accent2 ED7D31
accent3 A5A5A5
accent4 FFC000
accent5 5B9BD5
accent6 70AD47
hlink 0563C1
folHlink 954F72

・グレースケール

name hex
dk2 000000
lt2 F8F8F8
accent1 DDDDDD
accent2 B2B2B2
accent3 969696
accent4 808080
accent5 5F5F5F
accent6 4D4D4D
hlink 5F5F5F
folHlink 919191

あとはお調べください:raised_hand:

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?