Intelligent color unifying method and device
By generating color tokens and automating the color unification process in PPT documents, the problem of relying on manual inspection for color unification in PPT documents is solved, achieving fast and efficient color unification operations.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- BEIJING BISCUIT TECH CO LTD
- Filing Date
- 2025-12-26
- Publication Date
- 2026-04-21
AI Technical Summary
Unifying the colors in PowerPoint documents relies on manual inspection and modification, which is tedious and prone to errors.
By obtaining the color attributes of all slide shapes in the PPT document, color tokens are generated and stored in the cache. In response to unified color operation requests, automatic color unification is performed, supporting restoration of the original color or unification of color according to the target token.
It enables the rapid unification of PPT document colors without manual document traversal, significantly saving manpower and time costs, and reducing operation time from hours to milliseconds.
Smart Images

Figure CN121904201A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of document information processing technology, specifically to a method and apparatus for intelligent color unification. Background Technology
[0002] In related technologies, color uniformity in PPT documents often relies on manual inspection and modification, which is cumbersome and prone to errors. Summary of the Invention
[0003] The main objective of this invention is to provide a method and apparatus for intelligent color unification, so as to overcome the shortcomings of related technologies.
[0004] To achieve the above objectives, according to a first aspect of the present invention, a color intelligent unification method is provided, comprising: acquiring a target PPT and then traversing all shapes of all slides in the target PPT document; extracting the underlying color attributes corresponding to each type of shape to obtain a color attribute set ColorFormat for each type of shape; generating a color token ColorFormatModel for the color attribute set ColorFormat; and assigning a unique identifier GUID to the color token ColorFormatModel; wherein the color attribute set ColorFormat and the color token ColorFormatModel are stored in a cache; and in response to a unified color operation request, performing color unification based on the unified type indicated by the operation request and the content of the cache.
[0005] Optionally, color unification based on the uniform type indicated by the operation request and the cached content includes: if the uniform type is to restore the original color, then the original color attributes of each shape are restored based on the original data in the cached color attribute set ColorFormat.
[0006] Optionally, color unification based on the uniform type indicated by the operation request and the cached content includes: if the uniform type is to unify colors according to the target token, then based on the target color token GUID indicated by the operation request. k The target color attribute set ColorFormat is matched from the cache with the same color token; the color configuration parameters indicated by the operation request are written into the ColorFormat field of the target color attribute set ColorFormat.
[0007] Optionally, the parameter write-back method includes writing back parameters based on theme color write-back rules or writing back parameters based on custom rules.
[0008] Optionally, writing the color configuration parameters indicated by the operation request into the ColorFormat field of the target color attribute set ColorFormat includes: writing back the theme color ObjectThemeColor, the light or dark offset information of the theme color, and the brightness adjustment information in the color configuration parameters indicated by the operation request to the ColorFormat field of the target color attribute set ColorFormat.
[0009] Optionally, writing the color configuration parameters indicated by the operation request into the ColorFormat field of the target color attribute set ColorFormat includes: writing back the customized RGB and brightness adjustment information in the color configuration parameters indicated by the operation request to the ColorFormat field of the target color attribute set ColorFormat.
[0010] Optionally, the color attribute set ColorFormat includes the theme color ObjectThemeColor, the light or dark shade of the theme color TintAndShade, brightness, and color RGB value.
[0011] According to a second aspect of the present invention, a color intelligent unification device is provided, comprising a preprocessing unit, configured to acquire a target PPT and then traverse all shapes of all slides in the target PPT document, extract the underlying color attributes corresponding to each type of shape, obtain a color attribute set ColorFormat for each type of shape, generate a color token ColorFormatModel for the color attribute set ColorFormat, and assign a unique identifier GUID to the color token ColorFormatModel, wherein the color attribute set ColorFormat and the color token ColorFormatModel are stored in a cache; and a color unification unit, configured to respond to a unified color operation request and perform color unification based on the unification type indicated by the operation request and the content of the cache.
[0012] According to a third aspect of the present invention, a computer-readable storage medium is provided, the computer-readable storage medium storing computer instructions for causing the computer to perform the method described in any one of the first aspects.
[0013] According to a fourth aspect of the present invention, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores a computer program executable by the at least one processor, the computer program being executed by the at least one processor to cause the at least one processor to perform the method described in any implementation of the first aspect.
[0014] This embodiment of the intelligent color unification method and apparatus includes: acquiring a target PPT, traversing all shapes of all slides in the target PPT document, extracting the underlying color attributes corresponding to each type of shape to obtain a color attribute set ColorFormat for each type of shape, generating a color token ColorFormatModel for the color attribute set ColorFormat, and assigning a unique identifier GUID to the color token ColorFormatModel. The color attribute set ColorFormat and the color token ColorFormatModel are stored in a cache. In response to a unified color operation request, color unification is performed based on the unification type indicated by the operation request and the cached content. By intelligently unifying PPT colors, the drawbacks of PPT document color unification, which often relies on manual inspection and modification, are cumbersome and prone to errors. Attached Figure Description
[0015] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0016] Figure 1 This is a flowchart of the color intelligent unification method according to an embodiment of the present invention; Figure 2 This is a schematic diagram of an electronic device according to an embodiment of the present invention. Detailed Implementation
[0017] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0018] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate for the embodiments of the invention described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0019] It should be noted that, unless otherwise specified, the embodiments and features described in the present invention can be combined with each other. The present invention will now be described in detail with reference to the accompanying drawings and embodiments.
[0020] According to embodiments of the present invention, a color intelligent unification method is provided, such as... Figure 1 As shown, steps 101 to 102 are included below: Step 101: After obtaining the target PPT, iterate through all the shapes of all slides in the target PPT document, extract the underlying color attributes corresponding to each type of shape, obtain the color attribute set ColorFormat for each type of shape, generate a color token ColorFormatModel for the color attribute set ColorFormat, and assign a unique identifier GUID to the color token ColorFormatModel. The color attribute set ColorFormat and the color token ColorFormatModel are stored in the cache.
[0021] In this step, the file structure of the target PPT document is read. All slides are traversed in ascending order of slide number. For each slide, the shape index table is parsed to obtain the shape ID, shape type, and the enabled status of each channel (e.g., fill, line, text, glow, and shadow channels). For each channel with enabled color configuration, the corresponding shape's ColorFormat property set is extracted. The following data is written to a temporary cache space via caching: the original underlying properties of ColorFormat, i.e., the raw data ObjectThemeColor, TintAndShade, Brightness, and RGB. Each ColorFormat is assigned a unique ID to identify the shape to which it belongs.
[0022] Each cached ColorFormat raw data is converted into a readable and writable JSON data model according to a preset protocol, generating a token ColorFormatModel, and exposing the query and modification permissions of the color token to the outside world through an interface service.
[0023] Step 102: In response to the unified color operation request, perform color unification based on the unified type indicated by the operation request and the cached content.
[0024] In this step, unifying colors can include restoring the original theme color or writing back the shape color according to the token. For example, the external interface provides two atomic operations: UndoColors to restore the original color and ApplyColorToShapes to write back the shape color according to the token (supporting two paths: "theme color + TintAndShade / brightness" or "RGB + brightness").
[0025] As an optional implementation of this embodiment, color unification based on the unified type indicated by the operation request and the cached content includes: if the unified type is to restore the original color, then the original color attributes of each shape are restored based on the original data in the cached color attribute set ColorFormat.
[0026] In this optional implementation, the original color properties of all shapes are restored based on the cached original ColorFormat data.
[0027] As an optional implementation of this embodiment, color unification based on the uniform type indicated by the operation request and the cached content includes: if the uniform type is to unify the color according to the target token, then based on the target color token GUID indicated by the operation request. k The target color attribute set ColorFormat is matched from the cache with the same color token; the color configuration parameters indicated by the operation request are written into the ColorFormat field of the target color attribute set ColorFormat.
[0028] In this optional implementation, the color configuration parameters received from external input are located at the target shape using the unique ID of the color token, and the color configuration parameters are written back in batches to the ColorFormat property of the corresponding shape to achieve uniform adjustment of PPT document colors.
[0029] The methods for parameter write-back include writing back parameters based on theme color rules or writing back parameters based on custom rules.
[0030] As an optional implementation of this embodiment, writing the color configuration parameters indicated by the operation request into the ColorFormat field of the target color attribute set ColorFormat includes: writing back the theme color ObjectThemeColor, the light or dark offset information of the theme color, and the brightness adjustment information in the color configuration parameters indicated by the operation request to the ColorFormat field of the target color attribute set ColorFormat.
[0031] As an optional implementation of this embodiment, writing the color configuration parameters indicated by the operation request into the ColorFormat field of the target color attribute set ColorFormat includes: writing back the customized RGB and brightness adjustment information in the color configuration parameters indicated by the operation request to the ColorFormat field of the target color attribute set ColorFormat.
[0032] Write the color configuration parameters to the ColorFormat field of the target shape to complete color unification, including: i) Theme color path: Write in batches according to the configured ObjectThemeColor, TintAndShade, and Brightness parameters to achieve a unified color based on the theme color; ii) Custom RGB path: Calculate color values and write them in batches according to the configured RGB and Brightness parameters, automatically hide the ObjectThemeColor constraint, and achieve a unified color based on the custom color.
[0033] This embodiment eliminates the need for manual document traversal or repeated color parameter adjustments. Simply pass configuration parameters through the ApplyColorToShapes interface to unify the colors of hundreds or thousands of shapes, reducing operation time from "hours" to "milliseconds." It is especially suitable for complex PPT documents with multiple slides and shapes, significantly saving labor and time costs.
[0034] It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases the steps shown or described may be executed in a different order than that shown here.
[0035] According to an embodiment of the present invention, a color intelligent unification device is also provided, including a preprocessing unit, configured to acquire a target PPT and then traverse all shapes of all slides in the target PPT document, extract the underlying color attributes corresponding to each type of shape, obtain a color attribute set ColorFormat for each type of shape, generate a color token ColorFormatModel for the color attribute set ColorFormat, and assign a unique identifier GUID to the color token ColorFormatModel, wherein the color attribute set ColorFormat and the color token ColorFormatModel are stored in a cache; and a color unification unit, configured to respond to a unified color operation request and perform color unification based on the unification type indicated by the operation request and the content of the cache.
[0036] According to embodiments of the present invention, the present invention also provides an electronic device, the electronic device comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to implement the methods described in any of the above embodiments.
[0037] According to embodiments of the present invention, the present invention also provides a readable storage medium storing computer instructions that enable a computer to perform the methods described in any of the above embodiments when executed.
[0038] According to embodiments of the present invention, the present invention also provides a computer program product that, when executed by a processor, can implement the methods described in any of the above embodiments.
[0039] Figure 2 A schematic block diagram of an example electronic device 300 that can be used to implement embodiments of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices.
[0040] like Figure 2As shown, the electronic device 300 includes a computing unit 301, which can perform various appropriate actions and processes based on a computer program stored in a read-only memory (ROM) 302 or a computer program loaded from a storage unit 308 into a random access memory (RAM) 303. The RAM 303 may also store various programs and data required for the operation of the electronic device 300. The computing unit 301, ROM 302, and RAM 303 are interconnected via a bus 304. An input / output (I / O) interface 305 is also connected to the bus 304.
[0041] Multiple components in electronic device 300 are connected to I / O interface 305, including: input unit 306, such as keyboard, mouse, etc.; output unit 307, such as various types of displays, speakers, etc.; storage unit 308, such as disk, optical disk, etc.; and communication unit 309, such as network card, modem, wireless transceiver, etc. Communication unit 309 allows electronic device 300 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0042] The computing unit 301 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 301 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 301 performs the various methods and processes described above, such as the object matching method. For example, in some embodiments, the object matching method may be implemented as a computer software program tangibly contained in a machine-readable medium, such as storage unit 308. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 300 via ROM 302 and / or communication unit 309. When the computer program is loaded into RAM 303 and executed by the computing unit 301, one or more steps of the methods described above may be performed.
[0043] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0044] The program code used to implement the methods of the present invention can be written in any combination of one or more programming languages. This program code can be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing device, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code can be executed entirely on the machine, partially on the machine, as a standalone software package partially on the machine and partially on a remote machine, or entirely on a remote machine or server.
[0045] In the context of this invention, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. Machine-readable media can include, but are not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
Claims
1. A method for intelligent color unification, characterized in that, include: After obtaining the target PPT, iterate through all the shapes of all slides in the target PPT document, extract the underlying color attributes corresponding to each type of shape, obtain the color attribute set ColorFormat for each type of shape, generate a color token ColorFormatModel for the color attribute set ColorFormat, and assign a unique identifier GUID to the color token ColorFormatModel. The color attribute set ColorFormat and the color token ColorFormatModel are stored in the cache. In response to a unified color operation request, color unification is performed based on the unified type indicated by the operation request and the cached content.
2. The color intelligent unification method according to claim 1, characterized in that, Color unification based on the uniform type of the operation request indication and the cached content includes: If the unified type is to restore the original color, then the original color attributes of each shape are restored based on the original data in the cached color attribute set ColorFormat.
3. The color intelligent unification method according to claim 1, characterized in that, Color unification based on the uniform type of the operation request indication and the cached content includes: If the uniformity type is uniform color according to the target token, then the target color token GUID is based on the operation request. k Match the target color attribute set ColorFormat from the cache that corresponds to the same color token; Write the color configuration parameters indicated by the operation request into the ColorFormat field of the target color attribute set ColorFormat.
4. The color intelligent unification method according to claim 3, characterized in that, The methods for parameter write-back include writing back parameters based on theme color rules or writing back parameters based on custom rules.
5. The color intelligent unification method according to claim 4, characterized in that, Writing the color configuration parameters indicated by the operation request into the ColorFormat field of the target color attribute set ColorFormat includes: The theme color ObjectThemeColor, the light or dark offset information of the theme color, and the brightness adjustment information in the color configuration parameters indicated by the operation request are written back to the ColorFormat field of the target color attribute set ColorFormat.
6. The color intelligent unification method according to claim 4, characterized in that, Writing the color configuration parameters indicated by the operation request into the ColorFormat field of the target color attribute set ColorFormat includes: The custom RGB and brightness adjustment information in the color configuration parameters indicated by the operation request is written back to the ColorFormat field of the target color attribute set ColorFormat.
7. The color intelligent unification method according to claim 1, characterized in that, The color attribute set ColorFormat includes the theme color ObjectThemeColor, the light or dark shade of the theme color TintAndShade, brightness, and color RGB value.
8. A color intelligent unification device, characterized in that, include: The preprocessing unit is used to obtain the target PPT and then traverse all the shapes of all slides in the target PPT document. It extracts the underlying color attributes corresponding to each type of shape, obtains the color attribute set ColorFormat for each type of shape, generates a color token ColorFormatModel for the color attribute set ColorFormat, and assigns a unique identifier GUID to the color token ColorFormatModel. The color attribute set ColorFormat and the color token ColorFormatModel are stored in the cache. A color unification unit is used to respond to a color unification operation request and perform color unification based on the unification type indicated by the operation request and the cached content.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions for causing the computer to perform the method according to any one of claims 1-7.
10. An electronic device, characterized in that, include: At least one processor; And a memory communicatively connected to the at least one processor; wherein the memory stores a computer program executable by the at least one processor, the computer program being executed by the at least one processor to cause the at least one processor to perform the method according to any one of claims 1-7.