RELS.THEME = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme"; /* 20.1.6.2 clrScheme CT_ColorScheme */ function parse_clrScheme(t, opts) { themes.themeElements.clrScheme = []; var color = {}; t[0].match(/<[^>]*>/g).forEach(function(x) { var y = parsexmltag(x); switch(y[0]) { case '': break; /* 20.1.2.3.32 srgbClr CT_SRgbColor */ case '': case '': /* 20.1.4.1.10 dk2 (Dark 2) */ case '': case '': /* 20.1.4.1.22 lt1 (Light 1) */ case '': case '': /* 20.1.4.1.23 lt2 (Light 2) */ case '': case '': /* 20.1.4.1.1 accent1 (Accent 1) */ case '': case '': /* 20.1.4.1.2 accent2 (Accent 2) */ case '': case '': /* 20.1.4.1.3 accent3 (Accent 3) */ case '': case '': /* 20.1.4.1.4 accent4 (Accent 4) */ case '': case '': /* 20.1.4.1.5 accent5 (Accent 5) */ case '': case '': /* 20.1.4.1.6 accent6 (Accent 6) */ case '': case '': /* 20.1.4.1.19 hlink (Hyperlink) */ case '': case '': /* 20.1.4.1.15 folHlink (Followed Hyperlink) */ case '': case '': if (y[0][1] === '/') { themes.themeElements.clrScheme.push(color); color = {}; } else { color.name = y[0].substring(3, y[0].length - 1); } break; default: if(opts.WTF) throw 'unrecognized ' + y[0] + ' in clrScheme'; } }); } /* 14.2.7 Theme Part */ function parse_theme_xml(data, opts) { if(!data || data.length === 0) return themes; themes.themeElements = {}; var t; /* clrScheme CT_ColorScheme */ if((t=data.match(/]*)>.*<\/a:clrScheme>/))) parse_clrScheme(t, opts); return themes; } function write_theme() { return '\n'; }