@syncfusion/ej2-docx 0.0.0-stage → 35.1.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +68 -2
- package/core.js +4 -0
- package/dist/ej2-docx.umd.min.js +2 -0
- package/dist/ej2-docx.umd.min.js.map +1 -0
- package/dist/es6/ej2-docx.es2015.js +66697 -0
- package/dist/es6/ej2-docx.es2015.js.map +1 -0
- package/dist/es6/ej2-docx.es5.js +77568 -0
- package/dist/es6/ej2-docx.es5.js.map +1 -0
- package/dist/global/ej2-docx.min.js +2 -0
- package/dist/global/ej2-docx.min.js.map +1 -0
- package/dist/global/index.d.ts +5 -0
- package/features.js +4 -0
- package/index.js +4 -0
- package/license +10 -0
- package/package.json +31 -4
- package/src/all.d.ts +50 -0
- package/src/all.js +147 -0
- package/src/core/compat/base64.d.ts +13 -0
- package/src/core/compat/base64.js +90 -0
- package/src/core/compat/object-compat.d.ts +30 -0
- package/src/core/compat/object-compat.js +40 -0
- package/src/core/compat/sha256.d.ts +9 -0
- package/src/core/compat/sha256.js +98 -0
- package/src/core/errors/docx-error.d.ts +89 -0
- package/src/core/errors/docx-error.js +138 -0
- package/src/core/errors/error-codes.d.ts +8 -0
- package/src/core/errors/error-codes.js +0 -0
- package/src/core/errors/index.d.ts +10 -0
- package/src/core/errors/index.js +9 -0
- package/src/core/index.d.ts +12 -0
- package/src/core/index.js +12 -0
- package/src/core/mc/alternate-content.d.ts +7 -0
- package/src/core/mc/alternate-content.js +67 -0
- package/src/core/mc/attributes.d.ts +24 -0
- package/src/core/mc/attributes.js +82 -0
- package/src/core/mc/index.d.ts +7 -0
- package/src/core/mc/index.js +5 -0
- package/src/core/mc/inspect.d.ts +16 -0
- package/src/core/mc/inspect.js +148 -0
- package/src/core/mc/namespaces.d.ts +4 -0
- package/src/core/mc/namespaces.js +4 -0
- package/src/core/mc/scope.d.ts +6 -0
- package/src/core/mc/scope.js +47 -0
- package/src/core/opc/content-types.d.ts +34 -0
- package/src/core/opc/content-types.js +162 -0
- package/src/core/opc/index.d.ts +8 -0
- package/src/core/opc/index.js +4 -0
- package/src/core/opc/package.d.ts +49 -0
- package/src/core/opc/package.js +324 -0
- package/src/core/opc/part-name.d.ts +47 -0
- package/src/core/opc/part-name.js +205 -0
- package/src/core/opc/relationships.d.ts +46 -0
- package/src/core/opc/relationships.js +212 -0
- package/src/core/preservation/index.d.ts +2 -0
- package/src/core/preservation/index.js +1 -0
- package/src/core/preservation/opaque-body.d.ts +16 -0
- package/src/core/preservation/opaque-body.js +69 -0
- package/src/core/registry/block-handlers.d.ts +30 -0
- package/src/core/registry/block-handlers.js +36 -0
- package/src/core/registry/create-defaults.d.ts +39 -0
- package/src/core/registry/create-defaults.js +42 -0
- package/src/core/registry/feature-registry.d.ts +20 -0
- package/src/core/registry/feature-registry.js +29 -0
- package/src/core/registry/index.d.ts +9 -0
- package/src/core/registry/index.js +8 -0
- package/src/core/registry/inline-handlers.d.ts +20 -0
- package/src/core/registry/inline-handlers.js +30 -0
- package/src/core/registry/materialize-handlers.d.ts +35 -0
- package/src/core/registry/materialize-handlers.js +75 -0
- package/src/core/registry/multi-part-handlers.d.ts +37 -0
- package/src/core/registry/multi-part-handlers.js +206 -0
- package/src/core/registry/package-part-handlers.d.ts +28 -0
- package/src/core/registry/package-part-handlers.js +190 -0
- package/src/core/registry/part-handlers.d.ts +24 -0
- package/src/core/registry/part-handlers.js +172 -0
- package/src/core/registry/run-leaf-handlers.d.ts +26 -0
- package/src/core/registry/run-leaf-handlers.js +72 -0
- package/src/core/security/limits.d.ts +40 -0
- package/src/core/security/limits.js +26 -0
- package/src/core/xml/index.d.ts +7 -0
- package/src/core/xml/index.js +3 -0
- package/src/core/xml/model.d.ts +66 -0
- package/src/core/xml/model.js +17 -0
- package/src/core/xml/parse.d.ts +12 -0
- package/src/core/xml/parse.js +382 -0
- package/src/core/xml/serialize.d.ts +6 -0
- package/src/core/xml/serialize.js +93 -0
- package/src/core/zip/crc32.d.ts +2 -0
- package/src/core/zip/crc32.js +25 -0
- package/src/core/zip/deflate.d.ts +6 -0
- package/src/core/zip/deflate.js +6 -0
- package/src/core/zip/index.d.ts +10 -0
- package/src/core/zip/index.js +4 -0
- package/src/core/zip/inflate-raw.d.ts +17 -0
- package/src/core/zip/inflate-raw.js +450 -0
- package/src/core/zip/names.d.ts +6 -0
- package/src/core/zip/names.js +52 -0
- package/src/core/zip/read.d.ts +8 -0
- package/src/core/zip/read.js +262 -0
- package/src/core/zip/write.d.ts +7 -0
- package/src/core/zip/write.js +189 -0
- package/src/core/zip/zip-entry.d.ts +4 -0
- package/src/core/zip/zip-entry.js +0 -0
- package/src/features/bibliography/index.d.ts +100 -0
- package/src/features/bibliography/index.js +290 -0
- package/src/features/bookmarks/index.d.ts +331 -0
- package/src/features/bookmarks/index.js +1009 -0
- package/src/features/comments/comment-extensions.d.ts +157 -0
- package/src/features/comments/comment-extensions.js +356 -0
- package/src/features/comments/index.d.ts +579 -0
- package/src/features/comments/index.js +1727 -0
- package/src/features/content-controls/index.d.ts +821 -0
- package/src/features/content-controls/index.js +2857 -0
- package/src/features/custom-xml/index.d.ts +236 -0
- package/src/features/custom-xml/index.js +661 -0
- package/src/features/document/alignment.d.ts +23 -0
- package/src/features/document/alignment.js +36 -0
- package/src/features/document/alt-chunk.d.ts +103 -0
- package/src/features/document/alt-chunk.js +221 -0
- package/src/features/document/assert-never.d.ts +1 -0
- package/src/features/document/assert-never.js +4 -0
- package/src/features/document/augmentations.d.ts +578 -0
- package/src/features/document/augmentations.js +0 -0
- package/src/features/document/body-always-on.d.ts +36 -0
- package/src/features/document/body-always-on.js +66 -0
- package/src/features/document/body-blocks.d.ts +7 -0
- package/src/features/document/body-blocks.js +78 -0
- package/src/features/document/body-item-adapters.d.ts +62 -0
- package/src/features/document/body-item-adapters.js +97 -0
- package/src/features/document/body-item-collection.d.ts +151 -0
- package/src/features/document/body-item-collection.js +440 -0
- package/src/features/document/body-item.d.ts +35 -0
- package/src/features/document/body-item.js +8 -0
- package/src/features/document/body.d.ts +150 -0
- package/src/features/document/body.js +263 -0
- package/src/features/document/character-format.d.ts +413 -0
- package/src/features/document/character-format.js +2054 -0
- package/src/features/document/color.d.ts +178 -0
- package/src/features/document/color.js +495 -0
- package/src/features/document/document.d.ts +410 -0
- package/src/features/document/document.js +1049 -0
- package/src/features/document/element-type.d.ts +68 -0
- package/src/features/document/element-type.js +133 -0
- package/src/features/document/entity-type.d.ts +92 -0
- package/src/features/document/entity-type.js +93 -0
- package/src/features/document/feature-block.d.ts +16 -0
- package/src/features/document/feature-block.js +0 -0
- package/src/features/document/feature-inline.d.ts +13 -0
- package/src/features/document/feature-inline.js +0 -0
- package/src/features/document/feature-multi-package-part.d.ts +19 -0
- package/src/features/document/feature-multi-package-part.js +8 -0
- package/src/features/document/feature-package-level-part.d.ts +18 -0
- package/src/features/document/feature-package-level-part.js +8 -0
- package/src/features/document/feature-package-part.d.ts +14 -0
- package/src/features/document/feature-package-part.js +0 -0
- package/src/features/document/feature-run-leaf.d.ts +9 -0
- package/src/features/document/feature-run-leaf.js +0 -0
- package/src/features/document/headers-footers.d.ts +206 -0
- package/src/features/document/headers-footers.js +384 -0
- package/src/features/document/index.d.ts +41 -0
- package/src/features/document/index.js +34 -0
- package/src/features/document/length.d.ts +152 -0
- package/src/features/document/length.js +245 -0
- package/src/features/document/load-options.d.ts +14 -0
- package/src/features/document/load-options.js +0 -0
- package/src/features/document/locale-ids.d.ts +227 -0
- package/src/features/document/locale-ids.js +485 -0
- package/src/features/document/on-off.d.ts +9 -0
- package/src/features/document/on-off.js +27 -0
- package/src/features/document/page-setup.d.ts +339 -0
- package/src/features/document/page-setup.js +244 -0
- package/src/features/document/paragraph-format.d.ts +880 -0
- package/src/features/document/paragraph-format.js +2807 -0
- package/src/features/document/paragraph-item-collection.d.ts +162 -0
- package/src/features/document/paragraph-item-collection.js +363 -0
- package/src/features/document/paragraph-item.d.ts +83 -0
- package/src/features/document/paragraph-item.js +103 -0
- package/src/features/document/paragraph.d.ts +435 -0
- package/src/features/document/paragraph.js +888 -0
- package/src/features/document/run.d.ts +1 -0
- package/src/features/document/run.js +768 -0
- package/src/features/document/section-partition-flatten.d.ts +124 -0
- package/src/features/document/section-partition-flatten.js +217 -0
- package/src/features/document/section-properties-model.d.ts +13 -0
- package/src/features/document/section-properties-model.js +0 -0
- package/src/features/document/section.d.ts +93 -0
- package/src/features/document/section.js +178 -0
- package/src/features/document/sections.d.ts +103 -0
- package/src/features/document/sections.js +217 -0
- package/src/features/document/sub-super-script.d.ts +23 -0
- package/src/features/document/sub-super-script.js +43 -0
- package/src/features/document/text-range.d.ts +445 -0
- package/src/features/document/text-range.js +1156 -0
- package/src/features/document/typed-body-collections.d.ts +162 -0
- package/src/features/document/typed-body-collections.js +371 -0
- package/src/features/document/underline-style.d.ts +38 -0
- package/src/features/document/underline-style.js +126 -0
- package/src/features/document/units.d.ts +8 -0
- package/src/features/document/units.js +7 -0
- package/src/features/document/wml.d.ts +16 -0
- package/src/features/document/wml.js +67 -0
- package/src/features/drawing/authoring.d.ts +27 -0
- package/src/features/drawing/authoring.js +271 -0
- package/src/features/drawing/body-pr.d.ts +271 -0
- package/src/features/drawing/body-pr.js +663 -0
- package/src/features/drawing/drawing-shape.d.ts +1192 -0
- package/src/features/drawing/drawing-shape.js +3239 -0
- package/src/features/drawing/encode-builders.d.ts +176 -0
- package/src/features/drawing/encode-builders.js +390 -0
- package/src/features/drawing/fill-format.d.ts +52 -0
- package/src/features/drawing/fill-format.js +124 -0
- package/src/features/drawing/host-codec.d.ts +632 -0
- package/src/features/drawing/host-codec.js +2595 -0
- package/src/features/drawing/index.d.ts +13 -0
- package/src/features/drawing/index.js +33 -0
- package/src/features/drawing/line-format.d.ts +76 -0
- package/src/features/drawing/line-format.js +343 -0
- package/src/features/drawing/parse-register.d.ts +50 -0
- package/src/features/drawing/parse-register.js +257 -0
- package/src/features/drawing/residual-utils.d.ts +47 -0
- package/src/features/drawing/residual-utils.js +290 -0
- package/src/features/drawing/shape-types.d.ts +433 -0
- package/src/features/drawing/shape-types.js +437 -0
- package/src/features/drawing/sp-pr.d.ts +396 -0
- package/src/features/drawing/sp-pr.js +610 -0
- package/src/features/drawing/text-frame.d.ts +90 -0
- package/src/features/drawing/text-frame.js +152 -0
- package/src/features/drawing/types.d.ts +352 -0
- package/src/features/drawing/types.js +60 -0
- package/src/features/drawing/wrap-format.d.ts +62 -0
- package/src/features/drawing/wrap-format.js +114 -0
- package/src/features/editable-ranges/index.d.ts +494 -0
- package/src/features/editable-ranges/index.js +1348 -0
- package/src/features/fields/index.d.ts +428 -0
- package/src/features/fields/index.js +2148 -0
- package/src/features/fields/paragraph-field.d.ts +187 -0
- package/src/features/fields/paragraph-field.js +692 -0
- package/src/features/font-table/font-substitution-table.d.ts +75 -0
- package/src/features/font-table/font-substitution-table.js +257 -0
- package/src/features/font-table/font-table-entry.d.ts +255 -0
- package/src/features/font-table/font-table-entry.js +823 -0
- package/src/features/font-table/font-table.d.ts +128 -0
- package/src/features/font-table/font-table.js +313 -0
- package/src/features/font-table/index.d.ts +27 -0
- package/src/features/font-table/index.js +48 -0
- package/src/features/glossary/index.d.ts +97 -0
- package/src/features/glossary/index.js +286 -0
- package/src/features/headers-footers/index.d.ts +506 -0
- package/src/features/headers-footers/index.js +1666 -0
- package/src/features/hyperlinks/index.d.ts +230 -0
- package/src/features/hyperlinks/index.js +685 -0
- package/src/features/images/caption-authoring-api.d.ts +33 -0
- package/src/features/images/caption-authoring-api.js +33 -0
- package/src/features/images/caption-enums.d.ts +52 -0
- package/src/features/images/caption-enums.js +141 -0
- package/src/features/images/caption-host.d.ts +10 -0
- package/src/features/images/caption-host.js +21 -0
- package/src/features/images/captions.d.ts +13 -0
- package/src/features/images/captions.js +142 -0
- package/src/features/images/host-codec.d.ts +103 -0
- package/src/features/images/host-codec.js +720 -0
- package/src/features/images/image-sniff.d.ts +21 -0
- package/src/features/images/image-sniff.js +71 -0
- package/src/features/images/index.d.ts +506 -0
- package/src/features/images/index.js +1429 -0
- package/src/features/images/layout-types.d.ts +232 -0
- package/src/features/images/layout-types.js +294 -0
- package/src/features/images/public-entry.d.ts +9 -0
- package/src/features/images/public-entry.js +9 -0
- package/src/features/index.d.ts +35 -0
- package/src/features/index.js +36 -0
- package/src/features/mail-merge/index.d.ts +113 -0
- package/src/features/mail-merge/index.js +315 -0
- package/src/features/notes/index.d.ts +573 -0
- package/src/features/notes/index.js +1725 -0
- package/src/features/numbering/abstract-numbering.d.ts +90 -0
- package/src/features/numbering/abstract-numbering.js +292 -0
- package/src/features/numbering/index.d.ts +182 -0
- package/src/features/numbering/index.js +668 -0
- package/src/features/numbering/list-format.d.ts +158 -0
- package/src/features/numbering/list-format.js +590 -0
- package/src/features/numbering/list-string.d.ts +7 -0
- package/src/features/numbering/list-string.js +423 -0
- package/src/features/numbering/list-style.d.ts +204 -0
- package/src/features/numbering/list-style.js +1084 -0
- package/src/features/numbering/numbering-instance.d.ts +101 -0
- package/src/features/numbering/numbering-instance.js +329 -0
- package/src/features/numbering/numbering-level.d.ts +118 -0
- package/src/features/numbering/numbering-level.js +501 -0
- package/src/features/numbering/picture-bullet.d.ts +34 -0
- package/src/features/numbering/picture-bullet.js +88 -0
- package/src/features/ole-object/catalog.d.ts +300 -0
- package/src/features/ole-object/catalog.js +908 -0
- package/src/features/ole-object/index.d.ts +526 -0
- package/src/features/ole-object/index.js +1421 -0
- package/src/features/ole-object/relationship.d.ts +27 -0
- package/src/features/ole-object/relationship.js +27 -0
- package/src/features/ole-object/typed-dom.d.ts +186 -0
- package/src/features/ole-object/typed-dom.js +595 -0
- package/src/features/properties/index.d.ts +205 -0
- package/src/features/properties/index.js +549 -0
- package/src/features/revisions/index.d.ts +204 -0
- package/src/features/revisions/index.js +695 -0
- package/src/features/sections/column-collection.d.ts +119 -0
- package/src/features/sections/column-collection.js +478 -0
- package/src/features/sections/column.d.ts +15 -0
- package/src/features/sections/column.js +37 -0
- package/src/features/sections/index.d.ts +91 -0
- package/src/features/sections/index.js +1096 -0
- package/src/features/sections/margins.d.ts +40 -0
- package/src/features/sections/margins.js +105 -0
- package/src/features/sections/page-number-style.d.ts +21 -0
- package/src/features/sections/page-number-style.js +62 -0
- package/src/features/sections/page-orientation.d.ts +10 -0
- package/src/features/sections/page-orientation.js +10 -0
- package/src/features/sections/page-setup.d.ts +435 -0
- package/src/features/sections/page-setup.js +1479 -0
- package/src/features/sections/page-size.d.ts +59 -0
- package/src/features/sections/page-size.js +68 -0
- package/src/features/sections/section-break-code.d.ts +27 -0
- package/src/features/sections/section-break-code.js +60 -0
- package/src/features/sections/section-document-association.d.ts +18 -0
- package/src/features/sections/section-document-association.js +31 -0
- package/src/features/sections/section-validation.d.ts +43 -0
- package/src/features/sections/section-validation.js +97 -0
- package/src/features/settings/attached-template.d.ts +35 -0
- package/src/features/settings/attached-template.js +98 -0
- package/src/features/settings/compat-settings.d.ts +216 -0
- package/src/features/settings/compat-settings.js +508 -0
- package/src/features/settings/document-background.d.ts +59 -0
- package/src/features/settings/document-background.js +131 -0
- package/src/features/settings/document-protection.d.ts +65 -0
- package/src/features/settings/document-protection.js +157 -0
- package/src/features/settings/document-settings-facades.d.ts +108 -0
- package/src/features/settings/document-settings-facades.js +312 -0
- package/src/features/settings/document-settings-values.d.ts +43 -0
- package/src/features/settings/document-settings-values.js +60 -0
- package/src/features/settings/footnote-properties.d.ts +211 -0
- package/src/features/settings/footnote-properties.js +591 -0
- package/src/features/settings/index.d.ts +356 -0
- package/src/features/settings/index.js +829 -0
- package/src/features/settings/settings-children.d.ts +151 -0
- package/src/features/settings/settings-children.js +505 -0
- package/src/features/settings/web-settings.d.ts +88 -0
- package/src/features/settings/web-settings.js +227 -0
- package/src/features/settings/zoom.d.ts +79 -0
- package/src/features/settings/zoom.js +147 -0
- package/src/features/styles/builtin-catalog.d.ts +159 -0
- package/src/features/styles/builtin-catalog.js +963 -0
- package/src/features/styles/builtin-resolver.d.ts +49 -0
- package/src/features/styles/builtin-resolver.js +165 -0
- package/src/features/styles/default-styles.d.ts +37 -0
- package/src/features/styles/default-styles.js +186 -0
- package/src/features/styles/default-theme.d.ts +13 -0
- package/src/features/styles/default-theme.js +13 -0
- package/src/features/styles/doc-defaults.d.ts +58 -0
- package/src/features/styles/doc-defaults.js +178 -0
- package/src/features/styles/formatting-resolver.d.ts +27 -0
- package/src/features/styles/formatting-resolver.js +72 -0
- package/src/features/styles/index.d.ts +256 -0
- package/src/features/styles/index.js +1325 -0
- package/src/features/styles/latent-styles.d.ts +68 -0
- package/src/features/styles/latent-styles.js +305 -0
- package/src/features/styles/paragraph-properties.d.ts +71 -0
- package/src/features/styles/paragraph-properties.js +237 -0
- package/src/features/styles/run-properties.d.ts +93 -0
- package/src/features/styles/run-properties.js +516 -0
- package/src/features/styles/style-base.d.ts +402 -0
- package/src/features/styles/style-base.js +1026 -0
- package/src/features/styles/style-collection.d.ts +264 -0
- package/src/features/styles/style-collection.js +714 -0
- package/src/features/styles/style-format-bridge.d.ts +64 -0
- package/src/features/styles/style-format-bridge.js +100 -0
- package/src/features/styles/style.d.ts +84 -0
- package/src/features/styles/style.js +375 -0
- package/src/features/styles/styles-with-effects.d.ts +71 -0
- package/src/features/styles/styles-with-effects.js +180 -0
- package/src/features/styles/table-style.d.ts +272 -0
- package/src/features/styles/table-style.js +1226 -0
- package/src/features/styles/theme.d.ts +126 -0
- package/src/features/styles/theme.js +377 -0
- package/src/features/tables/border-style-map.d.ts +24 -0
- package/src/features/tables/border-style-map.js +81 -0
- package/src/features/tables/borders.d.ts +126 -0
- package/src/features/tables/borders.js +527 -0
- package/src/features/tables/collections.d.ts +113 -0
- package/src/features/tables/collections.js +261 -0
- package/src/features/tables/format.d.ts +208 -0
- package/src/features/tables/format.js +716 -0
- package/src/features/tables/index.d.ts +597 -0
- package/src/features/tables/index.js +2386 -0
- package/src/features/tables/paddings.d.ts +41 -0
- package/src/features/tables/paddings.js +97 -0
- package/src/features/tables/tbl-pr-positioning.d.ts +27 -0
- package/src/features/tables/tbl-pr-positioning.js +178 -0
- package/src/features/tables/tbl-pr.d.ts +528 -0
- package/src/features/tables/tbl-pr.js +1208 -0
- package/src/features/tables/tc-pr.d.ts +168 -0
- package/src/features/tables/tc-pr.js +553 -0
- package/src/features/tables/tr-pr.d.ts +60 -0
- package/src/features/tables/tr-pr.js +215 -0
- package/src/features/watermark/detect.d.ts +76 -0
- package/src/features/watermark/detect.js +219 -0
- package/src/features/watermark/index.d.ts +28 -0
- package/src/features/watermark/index.js +91 -0
- package/src/features/watermark/logical-store.d.ts +29 -0
- package/src/features/watermark/logical-store.js +31 -0
- package/src/features/watermark/model.d.ts +285 -0
- package/src/features/watermark/model.js +597 -0
- package/src/features/watermark/parse.d.ts +84 -0
- package/src/features/watermark/parse.js +815 -0
- package/src/features/watermark/serialize.d.ts +98 -0
- package/src/features/watermark/serialize.js +1517 -0
- package/src/global.js +1 -0
- package/src/index.d.ts +2 -0
- package/src/index.js +2 -0
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Named document colors used by character, paragraph, border, and fill APIs.
|
|
3
|
+
*
|
|
4
|
+
* Public surface is the enum; DOCX wire values are hex (`RRGGBB`), `auto`,
|
|
5
|
+
* or format-specific names (for example `ST_HighlightColor`).
|
|
6
|
+
*
|
|
7
|
+
* @public
|
|
8
|
+
*/
|
|
9
|
+
export declare enum Color {
|
|
10
|
+
Transparent = 0,
|
|
11
|
+
AliceBlue = 1,
|
|
12
|
+
AntiqueWhite = 2,
|
|
13
|
+
Aqua = 3,
|
|
14
|
+
Aquamarine = 4,
|
|
15
|
+
Azure = 5,
|
|
16
|
+
Beige = 6,
|
|
17
|
+
Bisque = 7,
|
|
18
|
+
Black = 8,
|
|
19
|
+
BlanchedAlmond = 9,
|
|
20
|
+
Blue = 10,
|
|
21
|
+
BlueViolet = 11,
|
|
22
|
+
Brown = 12,
|
|
23
|
+
BurlyWood = 13,
|
|
24
|
+
CadetBlue = 14,
|
|
25
|
+
Chartreuse = 15,
|
|
26
|
+
Chocolate = 16,
|
|
27
|
+
Coral = 17,
|
|
28
|
+
CornflowerBlue = 18,
|
|
29
|
+
Cornsilk = 19,
|
|
30
|
+
Crimson = 20,
|
|
31
|
+
Cyan = 21,
|
|
32
|
+
DarkBlue = 22,
|
|
33
|
+
DarkCyan = 23,
|
|
34
|
+
DarkGoldenrod = 24,
|
|
35
|
+
DarkGray = 25,
|
|
36
|
+
DarkGreen = 26,
|
|
37
|
+
DarkKhaki = 27,
|
|
38
|
+
DarkMagenta = 28,
|
|
39
|
+
DarkOliveGreen = 29,
|
|
40
|
+
DarkOrange = 30,
|
|
41
|
+
DarkOrchid = 31,
|
|
42
|
+
DarkRed = 32,
|
|
43
|
+
DarkSalmon = 33,
|
|
44
|
+
DarkSeaGreen = 34,
|
|
45
|
+
DarkSlateBlue = 35,
|
|
46
|
+
DarkSlateGray = 36,
|
|
47
|
+
DarkTurquoise = 37,
|
|
48
|
+
DarkViolet = 38,
|
|
49
|
+
DeepPink = 39,
|
|
50
|
+
DeepSkyBlue = 40,
|
|
51
|
+
DimGray = 41,
|
|
52
|
+
DodgerBlue = 42,
|
|
53
|
+
Firebrick = 43,
|
|
54
|
+
FloralWhite = 44,
|
|
55
|
+
ForestGreen = 45,
|
|
56
|
+
Fuchsia = 46,
|
|
57
|
+
Gainsboro = 47,
|
|
58
|
+
GhostWhite = 48,
|
|
59
|
+
Gold = 49,
|
|
60
|
+
Goldenrod = 50,
|
|
61
|
+
Gray = 51,
|
|
62
|
+
Green = 52,
|
|
63
|
+
GreenYellow = 53,
|
|
64
|
+
Honeydew = 54,
|
|
65
|
+
HotPink = 55,
|
|
66
|
+
IndianRed = 56,
|
|
67
|
+
Indigo = 57,
|
|
68
|
+
Ivory = 58,
|
|
69
|
+
Khaki = 59,
|
|
70
|
+
Lavender = 60,
|
|
71
|
+
LavenderBlush = 61,
|
|
72
|
+
LawnGreen = 62,
|
|
73
|
+
LemonChiffon = 63,
|
|
74
|
+
LightBlue = 64,
|
|
75
|
+
LightCoral = 65,
|
|
76
|
+
LightCyan = 66,
|
|
77
|
+
LightGoldenrodYellow = 67,
|
|
78
|
+
LightGreen = 68,
|
|
79
|
+
LightGray = 69,
|
|
80
|
+
LightPink = 70,
|
|
81
|
+
LightSalmon = 71,
|
|
82
|
+
LightSeaGreen = 72,
|
|
83
|
+
LightSkyBlue = 73,
|
|
84
|
+
LightSlateGray = 74,
|
|
85
|
+
LightSteelBlue = 75,
|
|
86
|
+
LightYellow = 76,
|
|
87
|
+
Lime = 77,
|
|
88
|
+
LimeGreen = 78,
|
|
89
|
+
Linen = 79,
|
|
90
|
+
Magenta = 80,
|
|
91
|
+
Maroon = 81,
|
|
92
|
+
MediumAquamarine = 82,
|
|
93
|
+
MediumBlue = 83,
|
|
94
|
+
MediumOrchid = 84,
|
|
95
|
+
MediumPurple = 85,
|
|
96
|
+
MediumSeaGreen = 86,
|
|
97
|
+
MediumSlateBlue = 87,
|
|
98
|
+
MediumSpringGreen = 88,
|
|
99
|
+
MediumTurquoise = 89,
|
|
100
|
+
MediumVioletRed = 90,
|
|
101
|
+
MidnightBlue = 91,
|
|
102
|
+
MintCream = 92,
|
|
103
|
+
MistyRose = 93,
|
|
104
|
+
Moccasin = 94,
|
|
105
|
+
NavajoWhite = 95,
|
|
106
|
+
Navy = 96,
|
|
107
|
+
OldLace = 97,
|
|
108
|
+
Olive = 98,
|
|
109
|
+
OliveDrab = 99,
|
|
110
|
+
Orange = 100,
|
|
111
|
+
OrangeRed = 101,
|
|
112
|
+
Orchid = 102,
|
|
113
|
+
PaleGoldenrod = 103,
|
|
114
|
+
PaleGreen = 104,
|
|
115
|
+
PaleTurquoise = 105,
|
|
116
|
+
PaleVioletRed = 106,
|
|
117
|
+
PapayaWhip = 107,
|
|
118
|
+
PeachPuff = 108,
|
|
119
|
+
Peru = 109,
|
|
120
|
+
Pink = 110,
|
|
121
|
+
Plum = 111,
|
|
122
|
+
PowderBlue = 112,
|
|
123
|
+
Purple = 113,
|
|
124
|
+
Red = 114,
|
|
125
|
+
RosyBrown = 115,
|
|
126
|
+
RoyalBlue = 116,
|
|
127
|
+
SaddleBrown = 117,
|
|
128
|
+
Salmon = 118,
|
|
129
|
+
SandyBrown = 119,
|
|
130
|
+
SeaGreen = 120,
|
|
131
|
+
SeaShell = 121,
|
|
132
|
+
Sienna = 122,
|
|
133
|
+
Silver = 123,
|
|
134
|
+
SkyBlue = 124,
|
|
135
|
+
SlateBlue = 125,
|
|
136
|
+
SlateGray = 126,
|
|
137
|
+
Snow = 127,
|
|
138
|
+
SpringGreen = 128,
|
|
139
|
+
SteelBlue = 129,
|
|
140
|
+
Tan = 130,
|
|
141
|
+
Teal = 131,
|
|
142
|
+
Thistle = 132,
|
|
143
|
+
Tomato = 133,
|
|
144
|
+
Turquoise = 134,
|
|
145
|
+
Violet = 135,
|
|
146
|
+
Wheat = 136,
|
|
147
|
+
White = 137,
|
|
148
|
+
WhiteSmoke = 138,
|
|
149
|
+
Yellow = 139,
|
|
150
|
+
YellowGreen = 140
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* Normalize a DOCX color token to uppercase RRGGBB without `#`.
|
|
154
|
+
* @private
|
|
155
|
+
*/
|
|
156
|
+
export declare function normalizeColorHex(raw: string): string | undefined;
|
|
157
|
+
/**
|
|
158
|
+
* Map a DOCX color wire value (`auto`, hex, or CSS name) to {@link Color}.
|
|
159
|
+
* Unknown values return `undefined` (caller keeps raw wire for round-trip).
|
|
160
|
+
* @private
|
|
161
|
+
*/
|
|
162
|
+
export declare function colorFromWire(raw: string | undefined): Color | undefined;
|
|
163
|
+
/**
|
|
164
|
+
* Serialize {@link Color} for `w:color` / border / shd fill (hex or auto-like).
|
|
165
|
+
* Transparent → empty string (caller may omit or use special handling).
|
|
166
|
+
* @private
|
|
167
|
+
*/
|
|
168
|
+
export declare function colorToHexWire(color: Color): string;
|
|
169
|
+
/**
|
|
170
|
+
* ST_HighlightColor name for a {@link Color}, when representable.
|
|
171
|
+
* @private
|
|
172
|
+
*/
|
|
173
|
+
export declare function colorToHighlightWire(color: Color): string | undefined;
|
|
174
|
+
/**
|
|
175
|
+
* Map ST_HighlightColor wire name to {@link Color}.
|
|
176
|
+
* @private
|
|
177
|
+
*/
|
|
178
|
+
export declare function highlightWireToColor(raw: string | undefined): Color | undefined;
|
|
@@ -0,0 +1,495 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Named document colors used by character, paragraph, border, and fill APIs.
|
|
3
|
+
*
|
|
4
|
+
* Public surface is the enum; DOCX wire values are hex (`RRGGBB`), `auto`,
|
|
5
|
+
* or format-specific names (for example `ST_HighlightColor`).
|
|
6
|
+
*
|
|
7
|
+
* @public
|
|
8
|
+
*/
|
|
9
|
+
export var Color;
|
|
10
|
+
(function (Color) {
|
|
11
|
+
Color[Color["Transparent"] = 0] = "Transparent";
|
|
12
|
+
Color[Color["AliceBlue"] = 1] = "AliceBlue";
|
|
13
|
+
Color[Color["AntiqueWhite"] = 2] = "AntiqueWhite";
|
|
14
|
+
Color[Color["Aqua"] = 3] = "Aqua";
|
|
15
|
+
Color[Color["Aquamarine"] = 4] = "Aquamarine";
|
|
16
|
+
Color[Color["Azure"] = 5] = "Azure";
|
|
17
|
+
Color[Color["Beige"] = 6] = "Beige";
|
|
18
|
+
Color[Color["Bisque"] = 7] = "Bisque";
|
|
19
|
+
Color[Color["Black"] = 8] = "Black";
|
|
20
|
+
Color[Color["BlanchedAlmond"] = 9] = "BlanchedAlmond";
|
|
21
|
+
Color[Color["Blue"] = 10] = "Blue";
|
|
22
|
+
Color[Color["BlueViolet"] = 11] = "BlueViolet";
|
|
23
|
+
Color[Color["Brown"] = 12] = "Brown";
|
|
24
|
+
Color[Color["BurlyWood"] = 13] = "BurlyWood";
|
|
25
|
+
Color[Color["CadetBlue"] = 14] = "CadetBlue";
|
|
26
|
+
Color[Color["Chartreuse"] = 15] = "Chartreuse";
|
|
27
|
+
Color[Color["Chocolate"] = 16] = "Chocolate";
|
|
28
|
+
Color[Color["Coral"] = 17] = "Coral";
|
|
29
|
+
Color[Color["CornflowerBlue"] = 18] = "CornflowerBlue";
|
|
30
|
+
Color[Color["Cornsilk"] = 19] = "Cornsilk";
|
|
31
|
+
Color[Color["Crimson"] = 20] = "Crimson";
|
|
32
|
+
Color[Color["Cyan"] = 21] = "Cyan";
|
|
33
|
+
Color[Color["DarkBlue"] = 22] = "DarkBlue";
|
|
34
|
+
Color[Color["DarkCyan"] = 23] = "DarkCyan";
|
|
35
|
+
Color[Color["DarkGoldenrod"] = 24] = "DarkGoldenrod";
|
|
36
|
+
Color[Color["DarkGray"] = 25] = "DarkGray";
|
|
37
|
+
Color[Color["DarkGreen"] = 26] = "DarkGreen";
|
|
38
|
+
Color[Color["DarkKhaki"] = 27] = "DarkKhaki";
|
|
39
|
+
Color[Color["DarkMagenta"] = 28] = "DarkMagenta";
|
|
40
|
+
Color[Color["DarkOliveGreen"] = 29] = "DarkOliveGreen";
|
|
41
|
+
Color[Color["DarkOrange"] = 30] = "DarkOrange";
|
|
42
|
+
Color[Color["DarkOrchid"] = 31] = "DarkOrchid";
|
|
43
|
+
Color[Color["DarkRed"] = 32] = "DarkRed";
|
|
44
|
+
Color[Color["DarkSalmon"] = 33] = "DarkSalmon";
|
|
45
|
+
Color[Color["DarkSeaGreen"] = 34] = "DarkSeaGreen";
|
|
46
|
+
Color[Color["DarkSlateBlue"] = 35] = "DarkSlateBlue";
|
|
47
|
+
Color[Color["DarkSlateGray"] = 36] = "DarkSlateGray";
|
|
48
|
+
Color[Color["DarkTurquoise"] = 37] = "DarkTurquoise";
|
|
49
|
+
Color[Color["DarkViolet"] = 38] = "DarkViolet";
|
|
50
|
+
Color[Color["DeepPink"] = 39] = "DeepPink";
|
|
51
|
+
Color[Color["DeepSkyBlue"] = 40] = "DeepSkyBlue";
|
|
52
|
+
Color[Color["DimGray"] = 41] = "DimGray";
|
|
53
|
+
Color[Color["DodgerBlue"] = 42] = "DodgerBlue";
|
|
54
|
+
Color[Color["Firebrick"] = 43] = "Firebrick";
|
|
55
|
+
Color[Color["FloralWhite"] = 44] = "FloralWhite";
|
|
56
|
+
Color[Color["ForestGreen"] = 45] = "ForestGreen";
|
|
57
|
+
Color[Color["Fuchsia"] = 46] = "Fuchsia";
|
|
58
|
+
Color[Color["Gainsboro"] = 47] = "Gainsboro";
|
|
59
|
+
Color[Color["GhostWhite"] = 48] = "GhostWhite";
|
|
60
|
+
Color[Color["Gold"] = 49] = "Gold";
|
|
61
|
+
Color[Color["Goldenrod"] = 50] = "Goldenrod";
|
|
62
|
+
Color[Color["Gray"] = 51] = "Gray";
|
|
63
|
+
Color[Color["Green"] = 52] = "Green";
|
|
64
|
+
Color[Color["GreenYellow"] = 53] = "GreenYellow";
|
|
65
|
+
Color[Color["Honeydew"] = 54] = "Honeydew";
|
|
66
|
+
Color[Color["HotPink"] = 55] = "HotPink";
|
|
67
|
+
Color[Color["IndianRed"] = 56] = "IndianRed";
|
|
68
|
+
Color[Color["Indigo"] = 57] = "Indigo";
|
|
69
|
+
Color[Color["Ivory"] = 58] = "Ivory";
|
|
70
|
+
Color[Color["Khaki"] = 59] = "Khaki";
|
|
71
|
+
Color[Color["Lavender"] = 60] = "Lavender";
|
|
72
|
+
Color[Color["LavenderBlush"] = 61] = "LavenderBlush";
|
|
73
|
+
Color[Color["LawnGreen"] = 62] = "LawnGreen";
|
|
74
|
+
Color[Color["LemonChiffon"] = 63] = "LemonChiffon";
|
|
75
|
+
Color[Color["LightBlue"] = 64] = "LightBlue";
|
|
76
|
+
Color[Color["LightCoral"] = 65] = "LightCoral";
|
|
77
|
+
Color[Color["LightCyan"] = 66] = "LightCyan";
|
|
78
|
+
Color[Color["LightGoldenrodYellow"] = 67] = "LightGoldenrodYellow";
|
|
79
|
+
Color[Color["LightGreen"] = 68] = "LightGreen";
|
|
80
|
+
Color[Color["LightGray"] = 69] = "LightGray";
|
|
81
|
+
Color[Color["LightPink"] = 70] = "LightPink";
|
|
82
|
+
Color[Color["LightSalmon"] = 71] = "LightSalmon";
|
|
83
|
+
Color[Color["LightSeaGreen"] = 72] = "LightSeaGreen";
|
|
84
|
+
Color[Color["LightSkyBlue"] = 73] = "LightSkyBlue";
|
|
85
|
+
Color[Color["LightSlateGray"] = 74] = "LightSlateGray";
|
|
86
|
+
Color[Color["LightSteelBlue"] = 75] = "LightSteelBlue";
|
|
87
|
+
Color[Color["LightYellow"] = 76] = "LightYellow";
|
|
88
|
+
Color[Color["Lime"] = 77] = "Lime";
|
|
89
|
+
Color[Color["LimeGreen"] = 78] = "LimeGreen";
|
|
90
|
+
Color[Color["Linen"] = 79] = "Linen";
|
|
91
|
+
Color[Color["Magenta"] = 80] = "Magenta";
|
|
92
|
+
Color[Color["Maroon"] = 81] = "Maroon";
|
|
93
|
+
Color[Color["MediumAquamarine"] = 82] = "MediumAquamarine";
|
|
94
|
+
Color[Color["MediumBlue"] = 83] = "MediumBlue";
|
|
95
|
+
Color[Color["MediumOrchid"] = 84] = "MediumOrchid";
|
|
96
|
+
Color[Color["MediumPurple"] = 85] = "MediumPurple";
|
|
97
|
+
Color[Color["MediumSeaGreen"] = 86] = "MediumSeaGreen";
|
|
98
|
+
Color[Color["MediumSlateBlue"] = 87] = "MediumSlateBlue";
|
|
99
|
+
Color[Color["MediumSpringGreen"] = 88] = "MediumSpringGreen";
|
|
100
|
+
Color[Color["MediumTurquoise"] = 89] = "MediumTurquoise";
|
|
101
|
+
Color[Color["MediumVioletRed"] = 90] = "MediumVioletRed";
|
|
102
|
+
Color[Color["MidnightBlue"] = 91] = "MidnightBlue";
|
|
103
|
+
Color[Color["MintCream"] = 92] = "MintCream";
|
|
104
|
+
Color[Color["MistyRose"] = 93] = "MistyRose";
|
|
105
|
+
Color[Color["Moccasin"] = 94] = "Moccasin";
|
|
106
|
+
Color[Color["NavajoWhite"] = 95] = "NavajoWhite";
|
|
107
|
+
Color[Color["Navy"] = 96] = "Navy";
|
|
108
|
+
Color[Color["OldLace"] = 97] = "OldLace";
|
|
109
|
+
Color[Color["Olive"] = 98] = "Olive";
|
|
110
|
+
Color[Color["OliveDrab"] = 99] = "OliveDrab";
|
|
111
|
+
Color[Color["Orange"] = 100] = "Orange";
|
|
112
|
+
Color[Color["OrangeRed"] = 101] = "OrangeRed";
|
|
113
|
+
Color[Color["Orchid"] = 102] = "Orchid";
|
|
114
|
+
Color[Color["PaleGoldenrod"] = 103] = "PaleGoldenrod";
|
|
115
|
+
Color[Color["PaleGreen"] = 104] = "PaleGreen";
|
|
116
|
+
Color[Color["PaleTurquoise"] = 105] = "PaleTurquoise";
|
|
117
|
+
Color[Color["PaleVioletRed"] = 106] = "PaleVioletRed";
|
|
118
|
+
Color[Color["PapayaWhip"] = 107] = "PapayaWhip";
|
|
119
|
+
Color[Color["PeachPuff"] = 108] = "PeachPuff";
|
|
120
|
+
Color[Color["Peru"] = 109] = "Peru";
|
|
121
|
+
Color[Color["Pink"] = 110] = "Pink";
|
|
122
|
+
Color[Color["Plum"] = 111] = "Plum";
|
|
123
|
+
Color[Color["PowderBlue"] = 112] = "PowderBlue";
|
|
124
|
+
Color[Color["Purple"] = 113] = "Purple";
|
|
125
|
+
Color[Color["Red"] = 114] = "Red";
|
|
126
|
+
Color[Color["RosyBrown"] = 115] = "RosyBrown";
|
|
127
|
+
Color[Color["RoyalBlue"] = 116] = "RoyalBlue";
|
|
128
|
+
Color[Color["SaddleBrown"] = 117] = "SaddleBrown";
|
|
129
|
+
Color[Color["Salmon"] = 118] = "Salmon";
|
|
130
|
+
Color[Color["SandyBrown"] = 119] = "SandyBrown";
|
|
131
|
+
Color[Color["SeaGreen"] = 120] = "SeaGreen";
|
|
132
|
+
Color[Color["SeaShell"] = 121] = "SeaShell";
|
|
133
|
+
Color[Color["Sienna"] = 122] = "Sienna";
|
|
134
|
+
Color[Color["Silver"] = 123] = "Silver";
|
|
135
|
+
Color[Color["SkyBlue"] = 124] = "SkyBlue";
|
|
136
|
+
Color[Color["SlateBlue"] = 125] = "SlateBlue";
|
|
137
|
+
Color[Color["SlateGray"] = 126] = "SlateGray";
|
|
138
|
+
Color[Color["Snow"] = 127] = "Snow";
|
|
139
|
+
Color[Color["SpringGreen"] = 128] = "SpringGreen";
|
|
140
|
+
Color[Color["SteelBlue"] = 129] = "SteelBlue";
|
|
141
|
+
Color[Color["Tan"] = 130] = "Tan";
|
|
142
|
+
Color[Color["Teal"] = 131] = "Teal";
|
|
143
|
+
Color[Color["Thistle"] = 132] = "Thistle";
|
|
144
|
+
Color[Color["Tomato"] = 133] = "Tomato";
|
|
145
|
+
Color[Color["Turquoise"] = 134] = "Turquoise";
|
|
146
|
+
Color[Color["Violet"] = 135] = "Violet";
|
|
147
|
+
Color[Color["Wheat"] = 136] = "Wheat";
|
|
148
|
+
Color[Color["White"] = 137] = "White";
|
|
149
|
+
Color[Color["WhiteSmoke"] = 138] = "WhiteSmoke";
|
|
150
|
+
Color[Color["Yellow"] = 139] = "Yellow";
|
|
151
|
+
Color[Color["YellowGreen"] = 140] = "YellowGreen";
|
|
152
|
+
})(Color || (Color = {}));
|
|
153
|
+
/** Hex RRGGBB (no `#`) for each {@link Color}, empty for Transparent. @private */
|
|
154
|
+
var COLOR_HEX = {};
|
|
155
|
+
COLOR_HEX[Color.Transparent] = '';
|
|
156
|
+
COLOR_HEX[Color.AliceBlue] = 'F0F8FF';
|
|
157
|
+
COLOR_HEX[Color.AntiqueWhite] = 'FAEBD7';
|
|
158
|
+
COLOR_HEX[Color.Aqua] = '00FFFF';
|
|
159
|
+
COLOR_HEX[Color.Aquamarine] = '7FFFD4';
|
|
160
|
+
COLOR_HEX[Color.Azure] = 'F0FFFF';
|
|
161
|
+
COLOR_HEX[Color.Beige] = 'F5F5DC';
|
|
162
|
+
COLOR_HEX[Color.Bisque] = 'FFE4C4';
|
|
163
|
+
COLOR_HEX[Color.Black] = '000000';
|
|
164
|
+
COLOR_HEX[Color.BlanchedAlmond] = 'FFEBCD';
|
|
165
|
+
COLOR_HEX[Color.Blue] = '0000FF';
|
|
166
|
+
COLOR_HEX[Color.BlueViolet] = '8A2BE2';
|
|
167
|
+
COLOR_HEX[Color.Brown] = 'A52A2A';
|
|
168
|
+
COLOR_HEX[Color.BurlyWood] = 'DEB887';
|
|
169
|
+
COLOR_HEX[Color.CadetBlue] = '5F9EA0';
|
|
170
|
+
COLOR_HEX[Color.Chartreuse] = '7FFF00';
|
|
171
|
+
COLOR_HEX[Color.Chocolate] = 'D2691E';
|
|
172
|
+
COLOR_HEX[Color.Coral] = 'FF7F50';
|
|
173
|
+
COLOR_HEX[Color.CornflowerBlue] = '6495ED';
|
|
174
|
+
COLOR_HEX[Color.Cornsilk] = 'FFF8DC';
|
|
175
|
+
COLOR_HEX[Color.Crimson] = 'DC143C';
|
|
176
|
+
COLOR_HEX[Color.Cyan] = '00FFFF';
|
|
177
|
+
COLOR_HEX[Color.DarkBlue] = '00008B';
|
|
178
|
+
COLOR_HEX[Color.DarkCyan] = '008B8B';
|
|
179
|
+
COLOR_HEX[Color.DarkGoldenrod] = 'B8860B';
|
|
180
|
+
COLOR_HEX[Color.DarkGray] = 'A9A9A9';
|
|
181
|
+
COLOR_HEX[Color.DarkGreen] = '006400';
|
|
182
|
+
COLOR_HEX[Color.DarkKhaki] = 'BDB76B';
|
|
183
|
+
COLOR_HEX[Color.DarkMagenta] = '8B008B';
|
|
184
|
+
COLOR_HEX[Color.DarkOliveGreen] = '556B2F';
|
|
185
|
+
COLOR_HEX[Color.DarkOrange] = 'FF8C00';
|
|
186
|
+
COLOR_HEX[Color.DarkOrchid] = '9932CC';
|
|
187
|
+
COLOR_HEX[Color.DarkRed] = '8B0000';
|
|
188
|
+
COLOR_HEX[Color.DarkSalmon] = 'E9967A';
|
|
189
|
+
COLOR_HEX[Color.DarkSeaGreen] = '8FBC8F';
|
|
190
|
+
COLOR_HEX[Color.DarkSlateBlue] = '483D8B';
|
|
191
|
+
COLOR_HEX[Color.DarkSlateGray] = '2F4F4F';
|
|
192
|
+
COLOR_HEX[Color.DarkTurquoise] = '00CED1';
|
|
193
|
+
COLOR_HEX[Color.DarkViolet] = '9400D3';
|
|
194
|
+
COLOR_HEX[Color.DeepPink] = 'FF1493';
|
|
195
|
+
COLOR_HEX[Color.DeepSkyBlue] = '00BFFF';
|
|
196
|
+
COLOR_HEX[Color.DimGray] = '696969';
|
|
197
|
+
COLOR_HEX[Color.DodgerBlue] = '1E90FF';
|
|
198
|
+
COLOR_HEX[Color.Firebrick] = 'B22222';
|
|
199
|
+
COLOR_HEX[Color.FloralWhite] = 'FFFAF0';
|
|
200
|
+
COLOR_HEX[Color.ForestGreen] = '228B22';
|
|
201
|
+
COLOR_HEX[Color.Fuchsia] = 'FF00FF';
|
|
202
|
+
COLOR_HEX[Color.Gainsboro] = 'DCDCDC';
|
|
203
|
+
COLOR_HEX[Color.GhostWhite] = 'F8F8FF';
|
|
204
|
+
COLOR_HEX[Color.Gold] = 'FFD700';
|
|
205
|
+
COLOR_HEX[Color.Goldenrod] = 'DAA520';
|
|
206
|
+
COLOR_HEX[Color.Gray] = '808080';
|
|
207
|
+
COLOR_HEX[Color.Green] = '008000';
|
|
208
|
+
COLOR_HEX[Color.GreenYellow] = 'ADFF2F';
|
|
209
|
+
COLOR_HEX[Color.Honeydew] = 'F0FFF0';
|
|
210
|
+
COLOR_HEX[Color.HotPink] = 'FF69B4';
|
|
211
|
+
COLOR_HEX[Color.IndianRed] = 'CD5C5C';
|
|
212
|
+
COLOR_HEX[Color.Indigo] = '4B0082';
|
|
213
|
+
COLOR_HEX[Color.Ivory] = 'FFFFF0';
|
|
214
|
+
COLOR_HEX[Color.Khaki] = 'F0E68C';
|
|
215
|
+
COLOR_HEX[Color.Lavender] = 'E6E6FA';
|
|
216
|
+
COLOR_HEX[Color.LavenderBlush] = 'FFF0F5';
|
|
217
|
+
COLOR_HEX[Color.LawnGreen] = '7CFC00';
|
|
218
|
+
COLOR_HEX[Color.LemonChiffon] = 'FFFACD';
|
|
219
|
+
COLOR_HEX[Color.LightBlue] = 'ADD8E6';
|
|
220
|
+
COLOR_HEX[Color.LightCoral] = 'F08080';
|
|
221
|
+
COLOR_HEX[Color.LightCyan] = 'E0FFFF';
|
|
222
|
+
COLOR_HEX[Color.LightGoldenrodYellow] = 'FAFAD2';
|
|
223
|
+
COLOR_HEX[Color.LightGreen] = '90EE90';
|
|
224
|
+
COLOR_HEX[Color.LightGray] = 'D3D3D3';
|
|
225
|
+
COLOR_HEX[Color.LightPink] = 'FFB6C1';
|
|
226
|
+
COLOR_HEX[Color.LightSalmon] = 'FFA07A';
|
|
227
|
+
COLOR_HEX[Color.LightSeaGreen] = '20B2AA';
|
|
228
|
+
COLOR_HEX[Color.LightSkyBlue] = '87CEFA';
|
|
229
|
+
COLOR_HEX[Color.LightSlateGray] = '778899';
|
|
230
|
+
COLOR_HEX[Color.LightSteelBlue] = 'B0C4DE';
|
|
231
|
+
COLOR_HEX[Color.LightYellow] = 'FFFFE0';
|
|
232
|
+
COLOR_HEX[Color.Lime] = '00FF00';
|
|
233
|
+
COLOR_HEX[Color.LimeGreen] = '32CD32';
|
|
234
|
+
COLOR_HEX[Color.Linen] = 'FAF0E6';
|
|
235
|
+
COLOR_HEX[Color.Magenta] = 'FF00FF';
|
|
236
|
+
COLOR_HEX[Color.Maroon] = '800000';
|
|
237
|
+
COLOR_HEX[Color.MediumAquamarine] = '66CDAA';
|
|
238
|
+
COLOR_HEX[Color.MediumBlue] = '0000CD';
|
|
239
|
+
COLOR_HEX[Color.MediumOrchid] = 'BA55D3';
|
|
240
|
+
COLOR_HEX[Color.MediumPurple] = '9370DB';
|
|
241
|
+
COLOR_HEX[Color.MediumSeaGreen] = '3CB371';
|
|
242
|
+
COLOR_HEX[Color.MediumSlateBlue] = '7B68EE';
|
|
243
|
+
COLOR_HEX[Color.MediumSpringGreen] = '00FA9A';
|
|
244
|
+
COLOR_HEX[Color.MediumTurquoise] = '48D1CC';
|
|
245
|
+
COLOR_HEX[Color.MediumVioletRed] = 'C71585';
|
|
246
|
+
COLOR_HEX[Color.MidnightBlue] = '191970';
|
|
247
|
+
COLOR_HEX[Color.MintCream] = 'F5FFFA';
|
|
248
|
+
COLOR_HEX[Color.MistyRose] = 'FFE4E1';
|
|
249
|
+
COLOR_HEX[Color.Moccasin] = 'FFE4B5';
|
|
250
|
+
COLOR_HEX[Color.NavajoWhite] = 'FFDEAD';
|
|
251
|
+
COLOR_HEX[Color.Navy] = '000080';
|
|
252
|
+
COLOR_HEX[Color.OldLace] = 'FDF5E6';
|
|
253
|
+
COLOR_HEX[Color.Olive] = '808000';
|
|
254
|
+
COLOR_HEX[Color.OliveDrab] = '6B8E23';
|
|
255
|
+
COLOR_HEX[Color.Orange] = 'FFA500';
|
|
256
|
+
COLOR_HEX[Color.OrangeRed] = 'FF4500';
|
|
257
|
+
COLOR_HEX[Color.Orchid] = 'DA70D6';
|
|
258
|
+
COLOR_HEX[Color.PaleGoldenrod] = 'EEE8AA';
|
|
259
|
+
COLOR_HEX[Color.PaleGreen] = '98FB98';
|
|
260
|
+
COLOR_HEX[Color.PaleTurquoise] = 'AFEEEE';
|
|
261
|
+
COLOR_HEX[Color.PaleVioletRed] = 'DB7093';
|
|
262
|
+
COLOR_HEX[Color.PapayaWhip] = 'FFEFD5';
|
|
263
|
+
COLOR_HEX[Color.PeachPuff] = 'FFDAB9';
|
|
264
|
+
COLOR_HEX[Color.Peru] = 'CD853F';
|
|
265
|
+
COLOR_HEX[Color.Pink] = 'FFC0CB';
|
|
266
|
+
COLOR_HEX[Color.Plum] = 'DDA0DD';
|
|
267
|
+
COLOR_HEX[Color.PowderBlue] = 'B0E0E6';
|
|
268
|
+
COLOR_HEX[Color.Purple] = '800080';
|
|
269
|
+
COLOR_HEX[Color.Red] = 'FF0000';
|
|
270
|
+
COLOR_HEX[Color.RosyBrown] = 'BC8F8F';
|
|
271
|
+
COLOR_HEX[Color.RoyalBlue] = '4169E1';
|
|
272
|
+
COLOR_HEX[Color.SaddleBrown] = '8B4513';
|
|
273
|
+
COLOR_HEX[Color.Salmon] = 'FA8072';
|
|
274
|
+
COLOR_HEX[Color.SandyBrown] = 'F4A460';
|
|
275
|
+
COLOR_HEX[Color.SeaGreen] = '2E8B57';
|
|
276
|
+
COLOR_HEX[Color.SeaShell] = 'FFF5EE';
|
|
277
|
+
COLOR_HEX[Color.Sienna] = 'A0522D';
|
|
278
|
+
COLOR_HEX[Color.Silver] = 'C0C0C0';
|
|
279
|
+
COLOR_HEX[Color.SkyBlue] = '87CEEB';
|
|
280
|
+
COLOR_HEX[Color.SlateBlue] = '6A5ACD';
|
|
281
|
+
COLOR_HEX[Color.SlateGray] = '708090';
|
|
282
|
+
COLOR_HEX[Color.Snow] = 'FFFAFA';
|
|
283
|
+
COLOR_HEX[Color.SpringGreen] = '00FF7F';
|
|
284
|
+
COLOR_HEX[Color.SteelBlue] = '4682B4';
|
|
285
|
+
COLOR_HEX[Color.Tan] = 'D2B48C';
|
|
286
|
+
COLOR_HEX[Color.Teal] = '008080';
|
|
287
|
+
COLOR_HEX[Color.Thistle] = 'D8BFD8';
|
|
288
|
+
COLOR_HEX[Color.Tomato] = 'FF6347';
|
|
289
|
+
COLOR_HEX[Color.Turquoise] = '40E0D0';
|
|
290
|
+
COLOR_HEX[Color.Violet] = 'EE82EE';
|
|
291
|
+
COLOR_HEX[Color.Wheat] = 'F5DEB3';
|
|
292
|
+
COLOR_HEX[Color.White] = 'FFFFFF';
|
|
293
|
+
COLOR_HEX[Color.WhiteSmoke] = 'F5F5F5';
|
|
294
|
+
COLOR_HEX[Color.Yellow] = 'FFFF00';
|
|
295
|
+
COLOR_HEX[Color.YellowGreen] = '9ACD32';
|
|
296
|
+
var HEX_TO_COLOR = {};
|
|
297
|
+
(function buildHexIndex() {
|
|
298
|
+
var keys = Object.keys(COLOR_HEX);
|
|
299
|
+
for (var i = 0; i < keys.length; i++) {
|
|
300
|
+
var n = Number(keys[i]);
|
|
301
|
+
var hex = COLOR_HEX[n];
|
|
302
|
+
if (hex !== undefined && hex.length > 0) {
|
|
303
|
+
HEX_TO_COLOR[hex.toUpperCase()] = n;
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
})();
|
|
307
|
+
/**
|
|
308
|
+
* Normalize a DOCX color token to uppercase RRGGBB without `#`.
|
|
309
|
+
* @private
|
|
310
|
+
*/
|
|
311
|
+
export function normalizeColorHex(raw) {
|
|
312
|
+
var s = raw.trim();
|
|
313
|
+
if (s.length === 0) {
|
|
314
|
+
return undefined;
|
|
315
|
+
}
|
|
316
|
+
if (s.charAt(0) === '#') {
|
|
317
|
+
s = s.substring(1);
|
|
318
|
+
}
|
|
319
|
+
if (/^[0-9A-Fa-f]{6}$/.test(s)) {
|
|
320
|
+
return s.toUpperCase();
|
|
321
|
+
}
|
|
322
|
+
if (/^[0-9A-Fa-f]{3}$/.test(s)) {
|
|
323
|
+
var a = s.charAt(0);
|
|
324
|
+
var b = s.charAt(1);
|
|
325
|
+
var c = s.charAt(2);
|
|
326
|
+
return (a + a + b + b + c + c).toUpperCase();
|
|
327
|
+
}
|
|
328
|
+
return undefined;
|
|
329
|
+
}
|
|
330
|
+
/**
|
|
331
|
+
* Map a DOCX color wire value (`auto`, hex, or CSS name) to {@link Color}.
|
|
332
|
+
* Unknown values return `undefined` (caller keeps raw wire for round-trip).
|
|
333
|
+
* @private
|
|
334
|
+
*/
|
|
335
|
+
export function colorFromWire(raw) {
|
|
336
|
+
if (raw === undefined) {
|
|
337
|
+
return undefined;
|
|
338
|
+
}
|
|
339
|
+
var t = raw.trim();
|
|
340
|
+
if (t.length === 0) {
|
|
341
|
+
return undefined;
|
|
342
|
+
}
|
|
343
|
+
var lower = t.toLowerCase();
|
|
344
|
+
if (lower === 'auto' || lower === 'windowtext') {
|
|
345
|
+
return Color.Black;
|
|
346
|
+
}
|
|
347
|
+
if (lower === 'transparent' || lower === 'none') {
|
|
348
|
+
return Color.Transparent;
|
|
349
|
+
}
|
|
350
|
+
var hex = normalizeColorHex(t);
|
|
351
|
+
if (hex !== undefined) {
|
|
352
|
+
var byHex = HEX_TO_COLOR[hex];
|
|
353
|
+
if (byHex !== undefined) {
|
|
354
|
+
return byHex;
|
|
355
|
+
}
|
|
356
|
+
return undefined;
|
|
357
|
+
}
|
|
358
|
+
// CSS / named color (case-insensitive member name).
|
|
359
|
+
var compact = t.replace(/[\s_-]/g, '').toLowerCase();
|
|
360
|
+
var names = Object.keys(Color).filter(function (k) {
|
|
361
|
+
return isNaN(Number(k));
|
|
362
|
+
});
|
|
363
|
+
for (var i = 0; i < names.length; i++) {
|
|
364
|
+
var name_1 = names[i];
|
|
365
|
+
if (name_1.toLowerCase() === compact) {
|
|
366
|
+
return Color[name_1];
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
return undefined;
|
|
370
|
+
}
|
|
371
|
+
/**
|
|
372
|
+
* Serialize {@link Color} for `w:color` / border / shd fill (hex or auto-like).
|
|
373
|
+
* Transparent → empty string (caller may omit or use special handling).
|
|
374
|
+
* @private
|
|
375
|
+
*/
|
|
376
|
+
export function colorToHexWire(color) {
|
|
377
|
+
if (color === Color.Transparent) {
|
|
378
|
+
return '';
|
|
379
|
+
}
|
|
380
|
+
var hex = COLOR_HEX[color];
|
|
381
|
+
if (hex !== undefined && hex.length > 0) {
|
|
382
|
+
return hex;
|
|
383
|
+
}
|
|
384
|
+
return '000000';
|
|
385
|
+
}
|
|
386
|
+
/**
|
|
387
|
+
* ST_HighlightColor name for a {@link Color}, when representable.
|
|
388
|
+
* @private
|
|
389
|
+
*/
|
|
390
|
+
export function colorToHighlightWire(color) {
|
|
391
|
+
switch (color) {
|
|
392
|
+
case Color.Black:
|
|
393
|
+
return 'black';
|
|
394
|
+
case Color.Blue:
|
|
395
|
+
return 'blue';
|
|
396
|
+
case Color.Cyan:
|
|
397
|
+
case Color.Aqua:
|
|
398
|
+
return 'cyan';
|
|
399
|
+
case Color.DarkBlue:
|
|
400
|
+
case Color.Navy:
|
|
401
|
+
return 'darkBlue';
|
|
402
|
+
case Color.DarkCyan:
|
|
403
|
+
case Color.Teal:
|
|
404
|
+
return 'darkCyan';
|
|
405
|
+
case Color.DarkGray:
|
|
406
|
+
case Color.Gray:
|
|
407
|
+
case Color.DimGray:
|
|
408
|
+
return 'darkGray';
|
|
409
|
+
case Color.DarkGreen:
|
|
410
|
+
case Color.Green:
|
|
411
|
+
case Color.ForestGreen:
|
|
412
|
+
return 'darkGreen';
|
|
413
|
+
case Color.DarkMagenta:
|
|
414
|
+
case Color.Purple:
|
|
415
|
+
return 'darkMagenta';
|
|
416
|
+
case Color.DarkRed:
|
|
417
|
+
case Color.Maroon:
|
|
418
|
+
return 'darkRed';
|
|
419
|
+
case Color.Olive:
|
|
420
|
+
case Color.DarkOliveGreen:
|
|
421
|
+
case Color.DarkGoldenrod:
|
|
422
|
+
return 'darkYellow';
|
|
423
|
+
case Color.Lime:
|
|
424
|
+
case Color.LimeGreen:
|
|
425
|
+
case Color.LawnGreen:
|
|
426
|
+
return 'green';
|
|
427
|
+
case Color.LightGray:
|
|
428
|
+
case Color.Silver:
|
|
429
|
+
return 'lightGray';
|
|
430
|
+
case Color.Magenta:
|
|
431
|
+
case Color.Fuchsia:
|
|
432
|
+
return 'magenta';
|
|
433
|
+
case Color.Transparent:
|
|
434
|
+
return 'none';
|
|
435
|
+
case Color.Red:
|
|
436
|
+
return 'red';
|
|
437
|
+
case Color.White:
|
|
438
|
+
case Color.WhiteSmoke:
|
|
439
|
+
case Color.Snow:
|
|
440
|
+
return 'white';
|
|
441
|
+
case Color.Yellow:
|
|
442
|
+
case Color.Gold:
|
|
443
|
+
case Color.LightYellow:
|
|
444
|
+
return 'yellow';
|
|
445
|
+
default:
|
|
446
|
+
return undefined;
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
/**
|
|
450
|
+
* Map ST_HighlightColor wire name to {@link Color}.
|
|
451
|
+
* @private
|
|
452
|
+
*/
|
|
453
|
+
export function highlightWireToColor(raw) {
|
|
454
|
+
if (raw === undefined) {
|
|
455
|
+
return undefined;
|
|
456
|
+
}
|
|
457
|
+
switch (raw) {
|
|
458
|
+
case 'black':
|
|
459
|
+
return Color.Black;
|
|
460
|
+
case 'blue':
|
|
461
|
+
return Color.Blue;
|
|
462
|
+
case 'cyan':
|
|
463
|
+
return Color.Cyan;
|
|
464
|
+
case 'darkBlue':
|
|
465
|
+
return Color.DarkBlue;
|
|
466
|
+
case 'darkCyan':
|
|
467
|
+
return Color.DarkCyan;
|
|
468
|
+
case 'darkGray':
|
|
469
|
+
return Color.DarkGray;
|
|
470
|
+
case 'darkGreen':
|
|
471
|
+
return Color.DarkGreen;
|
|
472
|
+
case 'darkMagenta':
|
|
473
|
+
return Color.DarkMagenta;
|
|
474
|
+
case 'darkRed':
|
|
475
|
+
return Color.DarkRed;
|
|
476
|
+
case 'darkYellow':
|
|
477
|
+
return Color.Olive;
|
|
478
|
+
case 'green':
|
|
479
|
+
return Color.Lime;
|
|
480
|
+
case 'lightGray':
|
|
481
|
+
return Color.LightGray;
|
|
482
|
+
case 'magenta':
|
|
483
|
+
return Color.Magenta;
|
|
484
|
+
case 'none':
|
|
485
|
+
return Color.Transparent;
|
|
486
|
+
case 'red':
|
|
487
|
+
return Color.Red;
|
|
488
|
+
case 'white':
|
|
489
|
+
return Color.White;
|
|
490
|
+
case 'yellow':
|
|
491
|
+
return Color.Yellow;
|
|
492
|
+
default:
|
|
493
|
+
return undefined;
|
|
494
|
+
}
|
|
495
|
+
}
|