Skip to content

Overriding scheme colors? #604

Open
Open
@igorski89

Description

@igorski89

Hi @gitbrent !

Thank you very much for all the work you've put into this project!

Lately I've been working on a project using this library and had a quite a pleasant time using it.

One of the tasks I had at hand is to override the default theme colors:
Screenshot 2019-10-05 at 17 41 53

Looking at the current APIs https://gitbrent.github.io/PptxGenJS/docs/shapes-and-schemes.html#powerpoint-scheme-colors it appears to be read-only.

In PowerPoint itself, this is possible to customize through the Slide Master editor.

Having a rather limited knowledge of the pptx format, I poked around and compared the contents of the standard and slightly customized color scheme via saved pptx files and quickly discovered the color scheme is stored inside ppt/theme/theme1.xml:
Screenshot 2019-10-05 at 17 27 03

I was thinking to prepare a PR with a new API, something in line of defineSlideMaster:

const pptx = new PptxGenJS();
pptx.defineThemeColors({
   accent1: 'FF40FF',
   ...
});

would something like be ok? And do you prefer a PR against the master or the version-3.0 branch?

Looking forward to your feedback!

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions