An icon editing method and device, electronic equipment and storage medium

By finding the target color value and obtaining style data from the icon file content, automatic icon editing is achieved, solving the problem of low icon editing efficiency and improving editing speed.

CN115202535BActive Publication Date: 2025-11-28BEIJING KINGSOFT OFFICE SOFTWARE INC +2
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210917454.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-08-01
Publication Date
2025-11-28
Estimated Expiration
2042-08-01

AI Technical Summary

Technical Problem

The low efficiency of icon editing in existing technologies is mainly due to the slow speed of manual editing by users.

Method used

By finding the target color value from the icon's file content and obtaining the style data for that target color value, the file content can be edited using the style data, thus enabling automatic icon editing.

Benefits of technology

It improves the automation and efficiency of icon editing, reducing the need for manual editing by users.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115202535B_ABST
    Figure CN115202535B_ABST
Patent Text Reader

Abstract

The application relates to the technical field of icon editing, and discloses an icon editing method, which comprises the following steps: acquiring file content of an icon, finding out a target color value of the icon from the file content, acquiring style data of the target color value, and editing the file content by using the style data. The target color value is found out from the file content of the icon, and the style data of the target color value is acquired. In this way, the file content can be edited by using the style data, so that automatic editing of the icon is realized without manual editing by a user. The automatic degree of icon editing is improved, and the efficiency of icon editing is improved. The application further discloses an icon editing device, an electronic equipment and a storage medium.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of icon editing, for example, to an icon editing method and device, an electronic device, and a storage medium. BACKGROUND

[0002] When making a website page, a user usually needs to edit an icon, for example, to control color change of the icon, to reduce the size of the icon, and the like.

[0003] In the process of implementing the embodiments of the present disclosure, it is found that at least the following problems exist in the related art:

[0004] In the related art, when editing an icon, a user can only manually edit the icon, and the speed of the user manually editing the icon is usually slow, which makes the efficiency of icon editing low. SUMMARY

[0005] The following presents a simplified summary of some aspects of the disclosed embodiments in order to provide a basic understanding of such embodiments. The summary is not an extensive overview of the disclosed embodiments and is not intended to identify key / critical elements of the embodiments or to delineate the scope of the embodiments. Its sole purpose is to present some aspects of the disclosed embodiments in a simplified form as a prelude to the more detailed description that is presented later.

[0006] The embodiments of the present disclosure provide an icon editing method and device, an electronic device, and a storage medium, so as to improve the efficiency of icon editing.

[0007] In some embodiments, the icon editing method comprises: obtaining file content of an icon, and finding a target color value of the icon from the file content; obtaining style data of the target color value, and editing the file content by using the style data.

[0008] In some embodiments, finding the target color value of the icon from the file content comprises: determining a color value same as a preset color value in the file content as the target color value.

[0009] In some embodiments, the style data is CSS (Cascading Style Sheets) style, obtaining the style data of the target color value comprises: matching a style name corresponding to the target color value from a preset style name database; the preset style name database stores a correspondence between target color values and style names; and matching a CSS style corresponding to the style name from a preset style database; the preset style database stores a correspondence between style names and CSS styles.

[0010] In some embodiments, editing the file content by using the style data comprises: inserting the style data into a preset position in a first preset character combination in the file content.

[0011] In some embodiments, the preset character combination includes a first preset character and a second preset character; and the preset position is a position between the first preset character and the second preset character.

[0012] In some embodiments, finding the target color value of the icon from the file content includes: obtaining a file extension of the icon, determining a type of the file extension and a type of the file content. In a case where the type of the file extension is a first preset type and the type of the file content is a second preset type, the target color value of the icon is found from the file content.

[0013] In some embodiments, after determining the type of the file extension and the type of the file content, the method further includes: in a case where the type of the file extension is not the first preset type and / or the type of the file content is not the second preset type, performing error prompt on the icon.

[0014] In some embodiments, before finding the target color value of the icon from the file content of the icon, the method further includes: obtaining redundant content in the file content by using a preset key string; and deleting the redundant content.

[0015] In some embodiments, the icon editing apparatus includes: a first obtaining module configured to obtain file content of an icon; a finding module configured to find a target color value of the icon from the file content; a second obtaining module configured to obtain style data of the target color value; and an editing module configured to edit the file content by using the style data.

[0016] In some embodiments, the electronic device includes a processor and a memory storing program instructions, and the processor is configured to execute the above icon editing method when executing the program instructions.

[0017] In some embodiments, the storage medium stores program instructions, and the program instructions execute the above icon editing method when running.

[0018] The icon editing method and apparatus, the electronic device, and the storage medium provided by the embodiments of the present disclosure can achieve the following technical effects: the target color value of the icon is found from the file content of the icon, and the style data of the target color value is obtained. Thus, the file content is edited by using the style data, and the automatic editing of the icon is achieved without manual editing by the user. The degree of automation of the icon editing is improved, and thus the efficiency of the icon editing is improved.

[0019] The foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the application. BRIEF DESCRIPTION OF DRAWINGS

[0020] One or more embodiments are illustrated by way of example in the figures that are not intended to be limiting of the application as defined by the claims. The drawings show, by way of example, embodiments in which the principles of the present application can be applied. Like reference numerals in the drawings designate analogous elements, and the drawings are not limiting of the application as defined by the claims. In the drawings:

[0021] Figure 1 is a schematic diagram of an icon editing method provided by an embodiment of the present disclosure;

[0022] Figure 2 is a schematic diagram of another icon editing method provided by an embodiment of the present disclosure;

[0023] Figure 3 is a schematic diagram of an application of an icon editing tool provided by an embodiment of the present disclosure;

[0024] Figure 4 is a schematic diagram of another icon editing method provided by an embodiment of the present disclosure;

[0025] Figure 5 is a schematic diagram of an icon editing device provided by an embodiment of the present disclosure;

[0026] Figure 6 is a schematic diagram of a structure of an electronic device provided by an embodiment of the present disclosure. DETAILED DESCRIPTION

[0027] In order to enable a more detailed understanding of the features and technical content of the embodiments of the present disclosure, the implementation of the embodiments of the present disclosure is described in detail below with reference to the accompanying drawings, which are only used for reference and do not limit the embodiments of the present disclosure. In the following technical description, in order to facilitate explanation, a plurality of details are provided to provide a full understanding of the disclosed embodiments. However, one or more embodiments can still be implemented without these details. In other cases, well-known structures and devices can be simplified to facilitate the drawings.

[0028] The terms "first", "second", and the like in the specification and claims of the embodiments of the present disclosure and the above drawings are used to distinguish similar objects, and do not necessarily describe a specific order or sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances to implement the embodiments of the present disclosure described herein. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion.

[0029] Unless otherwise specified, the term "a plurality of" means two or more.

[0030] In the embodiments of the present disclosure, the character " / " represents that the objects before and after the character are in an "or" relationship. For example, A / B means A or B.

[0031] The term "and / or" is a description of the association relationship of objects, which means that there can be three relationships. For example, A and / or B means that there are three relationships of A or B, or A and B.

[0032] The term "corresponding" can refer to an association relationship or a binding relationship. A and B correspond to each other means that A and B are in an association relationship or a binding relationship.

[0033] The present application can be applied to icon editing tools and the like software.

[0034] It should be noted that the execution subject of the embodiment of the present application can be an application running on a browser. The application is a web page program (Web App) of the browser on the terminal.

[0035] In addition, the electronic device involved in the embodiment of the present application can include but is not limited to a mobile phone, a personal digital assistant (PDA), a wireless handheld device, a tablet computer, a personal computer (PC), a palm computer (PDA, Personal Digital Assistants), and the like.

[0036] In combination Figure 1 As shown, the embodiment of the present disclosure provides an icon editing method, comprising:

[0037] Step S101, acquiring the file content of the icon.

[0038] Step S102, finding out the target color value of the icon from the file content.

[0039] Step S103, acquiring the style data of the target color value.

[0040] Step S104, editing the file content by using the style data.

[0041] By using the icon editing method provided by the embodiment of the present disclosure, the target color value is found out from the file content of the icon, and the style data of the target color value is acquired. In this way, the file content is edited by using the style data, so that the automatic editing of the icon can be realized without manual editing by the user. The degree of automation of icon editing is improved, and the efficiency of icon editing is improved.

[0042] In the embodiment, the icon is an SVG (Scalable Vector Graphics) icon. The file content corresponding to the icon includes: a version and encoding declared as supported by XML (Extensible Markup Language), an SVG document declaration, an SVG document size, an SVG document version, a file title name, a path grouping, and a path for drawing a graphic, and the like.

[0043] The step S101 of obtaining the file content of the icon is described in detail as follows: in response to an icon selection operation, reading the file content from the icon. The icon selection operation is that the user drags the selected icon into a preset operation area by using a mouse. In this way, since the icon is a text file, the file content of the icon can be obtained by directly reading the icon.

[0044] The step S102 of finding the target color value of the icon from the file content is described in detail as follows: determining the color value same as the preset color value in the file content as the target color value. In this way, the color value that can be modified can be found from the file content, and the color value is convenient to modify.

[0045] The preset color value includes one or more of #36425A, #417FF9, #E8802E, #FFFFFF, #C0C0C0, or #FFC0CB. For example, the color values same as the preset color value in the file content corresponding to the icon are #36425A and #417FF9, and #36425A and #417FF9 are determined as the target color value.

[0046] Further, the style data is a CSS style, and the step of obtaining the style data of the target color value includes: matching the style name corresponding to the target color value from a preset style name database, and the style name database stores a correspondence between the target color value and the style name; and matching the CSS style corresponding to the style name from a preset style database, and the style database stores a correspondence between the style name and the CSS style. In this way, the corresponding CSS style is directly matched from the preset style database, and the CSS style is convenient to add.

[0047] In some embodiments, as shown in Table 1, Table 1 is an example table of the preset style name database. For example, when the target color value is #36425A and #417FF9 are obtained, the style name corresponding to "#36425A" is matched from the style name database as "class="colorBlackStroke"". The style name corresponding to "#417FF9" is matched from the style name database as "class="colorBlueStroke"".

[0048] Style name Target color value class="colorBlackStroke" #36425A class="colorBlueStroke" #417FF9

[0049] Table 1

[0050] In some embodiments, as shown in Table 2, Table 2 is an example table of the preset style database. For example, the style names include "class="colorBlackStroke"" and "class="colorBlueStroke"". The CSS style corresponding to "class="colorBlackStroke"" is matched from the preset style database as "colorBlackStroke{fill:#36425A;}". The CSS style corresponding to "class="colorBlueStroke"" is matched from the preset style database as "colorBlueStroke{fill:#417FF9;}".

[0051]

[0052]

[0053] Table 2

[0054] Further, the file content is edited by using the style data, including: inserting the style data into a preset position in a first preset character combination in the file content. The preset character combination is "> <". The preset character combination is a character combination set in advance, and the preset character combination is used to confirm the position of inserting the style data.

[0055] Further, the preset character combination includes a first preset character and a second preset character, and the preset position is a position between the first preset character and the second preset character. The first preset character is ">" and the second preset character is "<". In some embodiments, the preset position is a position after the first preset character and before the second preset character.

[0056] In some embodiments, the obtained style data includes a CSS style "colorBlackStroke{fill:#36425A;}", a preset character combination "<>" is searched in the file content, and the CSS style is inserted between the first preset character ">" and the second preset character "<" in the first searched preset character combination "<>".

[0057] Optionally, after the style data is inserted into the preset position in the first preset character combination in the file content, the method further includes: replacing the target color value in the file content with a style name corresponding to the target color value. In this way, by using the style name to represent the target color value in the file content, the user can easily view the target color value in the file content.

[0058] In combination Figure 2 As shown in the drawings, the embodiments of the present disclosure provide a method for editing an icon, which includes:

[0059] In step S201, a target color value of the icon is searched from file content corresponding to the icon.

[0060] In step S202, a style name corresponding to the target color value is obtained.

[0061] In step S203, the target color value in the file content is replaced with the style name corresponding to the target color value, and a CSS style corresponding to the style name is obtained.

[0062] In step S204, the CSS style is inserted into a preset position in a first preset character combination in the file content.

[0063] By using the method for editing an icon provided by the embodiments of the present disclosure, the target color value in the file content is replaced with the style name, the target color value in the icon is represented by the CSS style, and the CSS style corresponding to the target color value is displayed at the preset position. This facilitates the user to quickly view, and the user can control the color change of the icon by adjusting the CSS style at the preset position. Therefore, the efficiency of the user in adjusting the color of the icon can be improved.

[0064] Further, searching the target color value of the icon from the file content of the icon includes: obtaining a file extension of the icon; determining a type of the file extension of the icon and determining a type of the file content of the icon; and in a case where the type of the file extension is a first preset type and the type of the file content is a second preset type, searching the target color value of the icon from the file content. In this way, by determining the file extension and the file content of the icon first, the user can easily edit the icon of the type.

[0065] Further, the file extension of the icon is acquired, including: in response to an icon selection operation, reading the file extension of the icon. The icon selection operation is that the user drags the selected icon into a preset operation area by a mouse. In this way, since the icon is a text file, the file extension of the icon can be obtained by directly reading the icon.

[0066] In some embodiments, the icon is determined in response to an icon selection operation. In a case where the type of the file extension corresponding to the icon is a first preset type, and the type of the file content corresponding to the icon is a second preset type, the icon is displayed in a preset operation area, and a style name searching operation and a CSS style adding operation are performed on the icon. The icon selection operation is that the user drags the selected icon into the preset operation area by a mouse. The style name searching operation is to search for a target color value of the icon from the file content corresponding to the icon, and to acquire a style name corresponding to the target color value. The CSS style adding operation is to acquire a CSS style corresponding to the style name, and to insert the CSS style into a preset position in the file content. The first preset type is “.svg”. The second preset type is “SVG file code”. In this way, the style name searching operation and the CSS style adding operation are performed on the SVG icon, which facilitates the user to quickly view, and the user only needs to adjust the CSS style at the preset position to control the color change of the icon. In this way, the efficiency of the user to adjust the color of the SVG icon is improved, and the efficiency of icon editing is improved.

[0067] Further, after determining the type of the file extension of the icon and the type of the file content of the icon, the method further includes: in a case where the type of the file extension of the icon is not the first preset type, and / or the type of the file content of the icon is not the second preset type, performing an error prompt on the icon. In this way, by judging the file extension and the file content of the icon, the corresponding error information is displayed in time, which can prompt the user, and facilitates the user to view and modify.

[0068] Optionally, the error prompt on the icon includes: displaying preset error information in a preset area. The preset error information includes “file extension error of the icon” and / or “file content error of the icon”.

[0069] In some embodiments, in a case where the type of the file extension of the icon is not the first preset type, preset error information is displayed in a preset area. The preset error information is “file extension error of the icon”.

[0070] In some embodiments, in the case that the type of the file content corresponding to the icon is not the second preset type, preset error information is displayed in the preset area. The preset error information is "error in the file content corresponding to the icon".

[0071] In some embodiments, in the case that the type of the file extension corresponding to the icon is not the first preset type, and the type of the file content corresponding to the icon is not the second preset type, preset error information is displayed in the preset area. The preset error information is "error in the file extension corresponding to the icon, error in the file content corresponding to the icon".

[0072] Optionally, the error prompt for the icon comprises: displaying the icon with a red exclamation mark in the preset area.

[0073] In some embodiments, in combination with Figure 3 as shown, Figure 3 An application schematic diagram of an icon editing tool is provided for the embodiments of the present disclosure. Figure 3 In the icon editing tool, a "background transparent" button, a "multicolor style" button, a "dual-color style" button, a "check" button, a "refresh" button, and a "determine output" button are included. The icon dragged into the preset operation area by the user through the mouse is determined as the icon. The icon editing tool determines the file extension and the file content corresponding to the icon by acquiring the drag-and-drop action of the mouse. In the case that the type of the file extension is ".svg", and the type of the file content is "SVG file code", the icon is displayed on the preset display position in the operation area. In the case that the type of the file extension is not ".svg", and the type of the file content is not "SVG file code", error information "error in the file extension corresponding to the icon, error in the file content corresponding to the icon" is displayed in the operation area. The preset operation area includes a plurality of display positions. In this way, a plurality of icons can be modified at the same time in batches, and the efficiency of editing icons is improved.

[0074] Optionally, in response to the determine output operation, the edited icon is output. The editing of the icon is completed. As Figure 3 shown, the icon editing tool is provided with a "determine output" button. The user selects the determine output operation by clicking the "determine output" button. In the case that the user clicks the "determine output" button, in response to the determine output operation, the icon editing tool outputs the edited icon.

[0075] Optionally, in response to the check operation, the icon is checked. The edited icon is checked. As Figure 3As shown, the icon editing tool is provided with a "multicolor style" button, a "dual-color style" button and a "check" button. The user selects to perform a check operation by clicking the "multicolor style" button, the "dual-color style" button or the "check" button. In the case where the user clicks the "multicolor style" button, the "dual-color style" button or the "check" button, the icon editing tool checks the icon in response to the check operation.

[0076] Optionally, the operation area is refreshed in response to a refresh operation. As shown in FIG. 6, the icon editing tool is provided with a "refresh" button. The user selects to perform a refresh operation by clicking the "refresh" button. In the case where the user clicks the "refresh" button, the icon editing tool refreshes the operation area in response to the refresh operation. Figure 3

[0077] Optionally, the background of the icon editing tool is adjusted in response to a background adjustment operation. As shown in FIG. 7, the icon editing tool is provided with a "background transparent" button. The user selects to perform a background adjustment operation by clicking the "background transparent" button. In the case where the user clicks the "background transparent" button, the background of the icon editing tool is adjusted in response to the background adjustment operation. Figure 3

[0078] Further, after the file content of the icon is acquired, the method further includes: acquiring redundant content in the file content by using a preset key string; and deleting the redundant content. In this way, since the redundant content is not a definition of the appearance of the icon, deleting the redundant content will not affect the appearance of the icon, and the size of the icon can be effectively reduced and the code can be simplified.

[0079] Optionally, the redundant content in the file content is acquired by using a preset key string, including: determining a text field including the key string in the file content as the redundant content. The preset key string includes one or more of "<?...>", "< <title>...< / title> >", "<g..." or "id=〞...〞". The redundant content includes one or more of an XML comment, a file title name, a path grouping or an ID (Identity document).

[0080] ​​In some embodiments, the key string "<?...>" is used to search for redundant content, and a text field containing the key string "<?...>" is determined as redundant content. For example, if the text field is "<?xml version="1.0"encoding="UTF-8"?>", the text field contains the key string "<?...>", and the text field is determined as redundant content and is deleted. In this way, the XML comment in the file content is deleted by using the key string "<?...>" to search for and delete the redundant content, and the size of the file content is reduced.

[0081] In some embodiments, the key string "##...##" is used to search for redundant content, and a text field containing the key string "##...##" is determined as redundant content. For example, if the text field is "##This is a file name##", the text field contains the key string "##...##", and the text field is determined as redundant content and is deleted. In this way, the file name in the file content is deleted by using the key string "##...##" to search for and delete the redundant content, and the size of the file content is reduced. <title>...< / title> <title>...< / title> <title>Paste< / title> <title>...< / title> <title>...< / title>

[0082] In some embodiments, the key string "<g... " is used to search for redundant content, and a text field containing the key string "<g... " is determined as redundant content. For example, if the text field is "<g id="#">", the text field contains the key string "<g... ", and the text field is determined as redundant content and is deleted. In this way, the path grouping in the file content is deleted by using the key string "<g... " to search for and delete the redundant content, and the size of the file content is reduced.

[0083] In some embodiments, the key string "id=〞...〞" is used to search for redundant content, and a text field containing the key string "id=〞...〞" is determined as redundant content. For example, if the text field is "id=〞path〞", the text field contains the key string "id=〞...〞", and the text field is determined as redundant content and is deleted. In this way, the ID in the file content is deleted by using the key string "id=〞...〞" to search for and delete the redundant content, and the size of the file content is reduced.

[0084] Optionally, a preset key string is used to search for redundant content from the file content of the icon, including: determining the number after the preset key string and the preset number of digits as redundant content. The preset key string is ".", and the preset number of digits is the fourth number. ​​​​​

[0085] In some embodiments, the redundant content is determined by using the key string "." for redundant content searching, and the number after the fourth digit after the key string "." is determined as the redundant content. For example, if the file content corresponding to the icon includes the "." text field "22.6418278", the content "278" after the fourth digit after the key string "." is determined as the redundant content and is deleted.

[0086] In combination Figure 4 The embodiment of the present disclosure provides an icon editing method, which comprises the following steps:

[0087] In step S401, the redundant content in the file content of the icon is obtained by using a preset key string.

[0088] In step S402, the redundant content is deleted.

[0089] In step S403, the target color value of the icon is found from the file content after the redundant content is deleted.

[0090] In step S404, the style name corresponding to the target color value is obtained.

[0091] In step S405, the CSS style corresponding to the style name is obtained.

[0092] In step S406, the CSS style is inserted into the preset position in the first preset character combination in the file content.

[0093] By using the icon editing method provided by the embodiment of the present disclosure, the target color value in the icon is represented by the CSS style, and the CSS style corresponding to the target color value is displayed in the preset position, so that the user can quickly check, and the user only needs to adjust the CSS style in the preset position to control the color change of the icon, thereby improving the efficiency of the user in adjusting the color of the icon. Meanwhile, since the redundant content is not a definition of the appearance of the icon, deleting the redundant content will not affect the appearance of the icon, and by deleting the redundant content in the file content, the size of the icon can be effectively reduced, and the code can be simplified.

[0094] Optionally, in combination Figure 5As shown, the embodiment of the present disclosure provides an icon editing device, which comprises a first obtaining module 501, a searching module 502, a second obtaining module 503 and an editing module 504. The first obtaining module 501 is configured to obtain the file content of an icon and send the file content of the icon to the searching module. The searching module 502 is configured to receive the file content of the icon sent by the first obtaining module, find the target color value of the icon from the file content, and send the target color value to the second obtaining module. The second obtaining module 503 is configured to receive the target color value sent by the searching module, obtain the style data of the target color value, and send the style data to the editing module. The editing module 504 is configured to receive the style data sent by the second obtaining module, and edit the file content by using the style data.

[0095] By using the icon editing device provided by the embodiment of the present disclosure, the file content of an icon is obtained by the first obtaining module, and the target color value of the icon is found from the file content by the searching module. The style data of the target color value is obtained by the second obtaining module, and the file content is edited by using the style data by the editing module. By finding the target color value from the file content of the icon and obtaining the style data of the target color value, the file content can be edited by using the style data, so that automatic editing of the icon is realized without manual editing by the user. The degree of automation of icon editing is improved, and thus the efficiency of icon editing is improved.

[0096] Further, the searching module is configured to find the target color value of the icon from the file content by the following method: determining the color value same as the preset color value in the file content as the target color value.

[0097] Further, the style data is CSS style, and the second obtaining module is configured to obtain the style data of the target color value by the following method: matching the style name corresponding to the target color value from the preset style name database, the preset style name database storing the correspondence between the target color value and the style name; and matching the CSS style corresponding to the style name from the preset style database, the preset style database storing the correspondence between the style name and the CSS style.

[0098] Further, the editing module is configured to edit the file content by using the style data by the following method, which comprises: inserting the style data into a preset position in a first preset character combination in the file content.

[0099] Further, the preset character combination comprises a first preset character and a second preset character, and the preset position is a position between the first preset character and the second preset character.

[0100] Further, the searching module is further configured to search the target color value of the icon from the file content by: obtaining a file extension of the icon, determining a type of the file extension and a type of the file content. In a case where the type of the file extension is a first preset type and the type of the file content is a second preset type, the target color value of the icon is searched from the file content.

[0101] Further, after determining the type of the file extension and the type of the file content, the method further includes: in a case where the type of the file extension is not the first preset type and / or the type of the file content is not the second preset type, performing error prompt on the icon.

[0102] Further, the icon editing device further includes a deleting module configured to, after obtaining the file content of the icon: obtain redundant content in the file content by using a preset key string; and delete the redundant content.

[0103] In the scenario of making a website page, it is usually required to control color change of an icon. Since the file content corresponding to the icon often includes other content in addition to color values, a user cannot quickly search the color to be controlled in the icon from the file content, resulting in low efficiency of the user in adjusting the color of the icon. The present application uses a CSS style to represent a target color value in the icon, and displays the CSS style corresponding to the target color value in a preset position. In this way, the user can quickly check, and the user can control the color change of the icon by adjusting the CSS style in the preset position. Thus, the efficiency of the user in adjusting the color of the icon is improved.

[0104] In combination Figure 6 As shown in the accompanying drawings, the present disclosure provides an electronic device, which includes a processor 600 and a memory 601 storing program instructions. Optionally, the electronic device can further include a communication interface 602 and a bus 603. The processor 600, the communication interface 602 and the memory 601 can complete mutual communication through the bus 603. The communication interface 602 can be used for information transmission. The processor 600 can invoke the logical instructions in the memory 601 to execute the icon editing method of the above-mentioned embodiments.

[0105] In addition, the program instructions in the memory 601 described above can be implemented in the form of a software functional unit and sold or used as an independent product, which can be stored in a computer readable storage medium.

[0106] The memory 601 can be used to store software programs, computer executable programs, such as program instructions / modules corresponding to the method in the embodiments of the present disclosure. The processor 600 executes the function application and data processing by running the program instructions / modules stored in the memory 601, that is, implements the method of icon editing in the above embodiments.

[0107] The memory 601 can include a program storage area and a data storage area. The program storage area can store an operating system and application programs required by at least one function; the data storage area can store data created according to the use of the terminal device, and the like. In addition, the memory 601 can include a high-speed random access memory, and can also include a non-volatile memory.

[0108] By using the electronic device provided in the embodiments of the present disclosure, the target color value is found from the file content of the icon, and the style data of the target color value is obtained. In this way, the icon is automatically edited by using the style data to edit the file content, without manual editing by the user. The degree of automation of icon editing is improved, and the efficiency of icon editing is improved.

[0109] Optionally, the electronic device includes a computer, a server, and the like.

[0110] The embodiments of the present disclosure provide a storage medium. When the program instructions are executed, the method of icon editing is performed.

[0111] The embodiments of the present disclosure provide a computer program product, which includes a computer program stored on a computer readable storage medium. The computer program includes program instructions, which, when executed by a computer, cause the computer to perform the method of icon editing.

[0112] The computer readable storage medium described above can be a transitory computer readable storage medium or a non-transitory computer readable storage medium.

[0113] The technical solutions of the embodiments of the present disclosure can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes one or more instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in the embodiments of the present disclosure. The aforementioned storage medium can be a non-transitory storage medium, including a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and various media that can store program codes, or a transitory storage medium.

[0114] The foregoing description and accompanying drawings fully illustrate embodiments of this disclosure to enable those skilled in the art to practice them. Other embodiments may include structural, logical, electrical, procedural, and other changes. The embodiments represent only possible variations. Individual components and functions are optional unless explicitly required, and the order of operation may vary. Parts and features of some embodiments may be included in or replace parts and features of other embodiments. Moreover, the terminology used in this application is for describing embodiments only and is not intended to limit the claims. As used in the description of embodiments and claims, the singular forms “a,” “an,” and “the” are intended to equally include the plural forms unless the context clearly indicates otherwise. Similarly, the term “and / or” as used in this application means including one or more of the associated listed items and all possible combinations thereof. Additionally, when used in this application, the term "comprise" and its variations "comprises" and / or "comprising" refer to the presence of stated features, integrals, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components, and / or groups thereof. Without further limitations, an element defined by the phrase "comprises a..." does not exclude the presence of other identical elements in the process, method, or apparatus that includes said element. In this document, each embodiment may focus on the differences from other embodiments, and similar or identical parts between embodiments can be referred to mutually. For methods, products, etc., disclosed in the embodiments, if they correspond to the method section disclosed in the embodiments, the relevant parts can be referred to the description of the method section.

[0115] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the embodiments of this disclosure. Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0116] In the embodiments disclosed herein, the disclosed methods, products (including but not limited to apparatuses, devices, etc.), can be implemented in other manners. For example, the described apparatus embodiments can be implemented only in a form of a logical function, and can be implemented by using a manner such as software (for example, application program) or the like. In some embodiments, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the displayed or discussed coupling or direct coupling or indirect coupling between different units, or the coupling or direct coupling or indirect coupling between the displayed or discussed communication connections can be in a form of electrical, mechanical or other forms.

[0117] The flowcharts and block diagrams in the drawings show the possible implementation architectures, functions and operations of the system, method and computer program product according to the embodiments of the present disclosure. In this regard, each block in the flowcharts or block diagrams can represent a module, a program segment or a part of code containing one or more executable instructions for implementing a specified logical function. In some alternative implementations, the functions noted in the blocks can occur in an order different from that noted in the drawings. For example, two consecutive blocks can actually be executed substantially in parallel, and sometimes they can be executed in reverse order, depending on the functions involved. In the descriptions corresponding to the flowcharts and block diagrams in the drawings, the operations or steps corresponding to different blocks can also occur in an order different from that disclosed in the descriptions, and sometimes there is no specific order between different operations or steps. For example, two consecutive operations or steps can actually be executed substantially in parallel, and sometimes they can be executed in reverse order, depending on the functions involved. Each block in the block diagrams and / or flowcharts, and the combination of blocks in the block diagrams and / or flowcharts, can be implemented by a dedicated hardware-based system that performs the specified functions or actions, or can be implemented by a combination of dedicated hardware and computer instructions.

Claims

1. A method of SVG icon editing, characterized by, The method comprises the following steps: obtaining file content of an icon; wherein the icon is an SVG icon; finding a target color value of the icon from the file content; obtaining style data of the target color value; the style data is Cascading Style Sheets (CSS) style; obtaining the style data of the target color value comprises the following steps: matching a style name corresponding to the target color value from a preset style name database; the preset style name database stores a corresponding relationship between the target color value and the style name; matching a CSS style corresponding to the style name from a preset style database; the preset style database stores a corresponding relationship between the style name and the CSS style; inserting the style data into a preset position in a first preset character combination in the file content; the preset character combination comprises a first preset character and a second preset character; the preset position is a position between the first preset character and the second preset character; after obtaining the file content of the icon, the method further comprises the following steps: obtaining redundant content in the file content by using a preset key string; deleting the redundant content; the redundant content is not a definition of an appearance of the icon, and deleting the redundant content does not affect the appearance of the icon; wherein the step of obtaining the redundant content in the file content by using the preset key string comprises the following steps: determining a text field comprising the key string in the file content as the redundant content; or determining a number after a preset number of digits after the preset key string as the redundant content.

2. The method of claim 1, wherein, The method comprises the following steps: determining a color value same as a preset color value in the file content as the target color value.

3. The method of claim 1, wherein, The method comprises the following steps: obtaining a file extension of the icon; determining a type of the file extension and a type of the file content; in a case where the type of the file extension is a first preset type and the type of the file content is a second preset type, finding the target color value of the icon from the file content.

4. The method of claim 3, wherein, after determining the type of the file extension and the type of the file content, the method further comprises the following steps: in a case where the type of the file extension is not the first preset type and / or the type of the file content is not the second preset type, performing error prompt on the icon.

5. The method of claim 1, wherein, after obtaining the file content of the icon, the method further comprises the following steps: obtaining redundant content in the file content by using a preset key string; deleting the redundant content.

6. An apparatus for SVG icon editing, characterized by The method comprises the following steps: a first obtaining module configured to obtain file content of an icon; wherein the icon is an SVG icon; a finding module configured to find a target color value of the icon from the file content; a determining module configured to determine a type of the file extension and a type of the file content; The second obtaining module is configured to obtain style data of the target color value; the style data is Cascading Style Sheet (CSS) style, and obtaining the style data of the target color value comprises: matching a style name corresponding to the target color value from a preset style name database; the style name database stores a correspondence between the target color value and the style name; and matching the CSS style corresponding to the style name from a preset style database; the style database stores a correspondence between the style name and the CSS style; The editing module is configured to insert the style data into a preset position in a first preset character combination in the file content; the preset character combination comprises a first preset character and a second preset character; and the preset position is a position between the first preset character and the second preset character; After obtaining the file content of the icon, the method further comprises: obtaining redundant content in the file content by using a preset key string; and deleting the redundant content; the redundant content is not a definition of an appearance of the icon, and deleting the redundant content does not affect the appearance of the icon. The processor is configured to execute the method for editing the SVG icon as claimed in any one of claims 1 to 6 when the program instruction is run.

7. An electronic device comprising a processor and a memory having stored program instructions, wherein the program instructions, when executed by the processor, cause the electronic device to perform the method of any one of claims 1-6. The program instruction is configured to execute the method for editing the SVG icon as claimed in any one of claims 1 to 6 when the program instruction is run.

8. A storage medium storing program instructions, characterized in that, ​

Citation Information

Patent Citations

  • Page color theme switching method and device, storage medium and electronic equipment

    CN111078221A

  • Theme style switching method and system

    CN114090160A