CN114780182B - Icon style switching method, device, equipment, medium and product - Google Patents

Icon style switching method, device, equipment, medium and product Download PDF

Info

Publication number
CN114780182B
CN114780182B CN202210243306.4A CN202210243306A CN114780182B CN 114780182 B CN114780182 B CN 114780182B CN 202210243306 A CN202210243306 A CN 202210243306A CN 114780182 B CN114780182 B CN 114780182B
Authority
CN
China
Prior art keywords
path
style
icon
determining
color
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202210243306.4A
Other languages
Chinese (zh)
Other versions
CN114780182A (en
Inventor
秦浩严
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN202210243306.4A priority Critical patent/CN114780182B/en
Publication of CN114780182A publication Critical patent/CN114780182A/en
Application granted granted Critical
Publication of CN114780182B publication Critical patent/CN114780182B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The disclosure provides a method, a device, equipment, a medium and a product for switching icon styles, relates to the technical field of computers, in particular to the field of application development, and can be used in cloud services and intelligent cloud scenes. The specific implementation scheme is as follows: determining the style to be switched of the icon and style information of the style to be switched; determining path descriptions of all paths forming the icon under the style to be switched; determining the path style of each path based on the path attribute value in the style information and the path attribute of each path in the path description; and switching the icon style based on the path style of each path in the icon. According to the method and the device, the path style corresponding to the path attribute of each path is determined through the path attribute value corresponding to the style to be switched, so that the icon style is switched. Compared with the method for realizing icon style switching in the related art, the method for switching the icon styles does not need to mark the path attribute of the path in the icon every time the icon styles are switched, and improves the efficiency of switching the icon styles.

Description

Icon style switching method, device, equipment, medium and product
Technical Field
The disclosure relates to the field of computer technology, in particular to the field of application development, and can be used in cloud services and intelligent cloud scenes.
Background
The visual designer needs to design icons with different styles according to different scenes, which not only needs more manpower to be input into the design work, but also increases the resource volume during research and development. The related art proposes a scheme of transforming a set of icons into a plurality of different styles. Through the scheme, a designer can meet various scenes by only designing one set of icons, and a researcher can convert icons with different styles by only introducing one set of resources, so that the switching of page theme can be realized.
Disclosure of Invention
The present disclosure provides a method, apparatus, device, medium, and product for switching icon styles.
According to an aspect of the present disclosure, there is provided a method of switching icon styles, including: determining the style to be switched of an icon and style information of the style to be switched; determining path descriptions of all paths forming the icon under the style to be switched; determining the path style of each path based on the path attribute value in the style information and the path attribute of each path in the path description; and switching the icon style based on the path style of each path in the icon.
According to another aspect of the present disclosure, there is provided an apparatus for switching icon styles, including: the first determining unit is used for determining the style to be switched of the icon and the style information of the style to be switched; a second determining unit, configured to determine a path description of each path constituting the icon in the style to be switched; a path style determining unit, configured to determine a path style of each path based on a path attribute value in the style information and a path attribute of each path in a path description; and the switching unit is used for switching the icon style based on the path style of each path in the icon.
According to still another aspect of the present disclosure, there is provided an electronic apparatus including: at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method.
According to yet another aspect of the present disclosure, there is provided a non-transitory computer-readable storage medium storing computer instructions for causing the computer to perform the method.
According to yet another aspect of the present disclosure, a computer program product is provided, comprising a computer program which, when executed by a processor, implements the described method.
It should be understood that the description in this section is not intended to identify key or critical features of the embodiments of the disclosure, nor is it intended to be used to limit the scope of the disclosure. Other features of the present disclosure will become apparent from the following specification.
Drawings
The drawings are for a better understanding of the present solution and are not to be construed as limiting the present disclosure. Wherein:
FIG. 1a is a schematic diagram of an open path provided in accordance with an embodiment of the present disclosure;
FIG. 1b is an illustrative diagram of a closed path provided in accordance with an embodiment of the present disclosure;
FIG. 2a is a schematic diagram of a style of ascending icons in a linear icon style provided in accordance with an embodiment of the present disclosure;
FIG. 2b is a schematic diagram of a style of ascending icons in a face icon style provided in accordance with an embodiment of the present disclosure;
FIG. 3 is a flow chart of a method of switching icon styles provided in accordance with an embodiment of the present disclosure;
FIG. 4 is a schematic diagram of displaying icon styles on a display interface provided in accordance with an embodiment of the present disclosure;
FIG. 5 is a schematic diagram showing custom style information on a display interface provided according to an embodiment of the present disclosure;
FIG. 6 is a flow chart of determining a path description under a style to be switched provided in accordance with an embodiment of the present disclosure;
FIG. 7 is a flow chart providing a description of a path in a particular determined style to be switched according to an embodiment of the present disclosure;
Fig. 8 is a schematic diagram of styles of open paths in icons before and after style switching provided according to an embodiment of the present disclosure;
FIG. 9 is a schematic diagram of switching endpoint types in icons provided in accordance with an embodiment of the present disclosure;
FIG. 10 is a schematic diagram of switching inflection point types in icons provided in accordance with an embodiment of the present disclosure;
FIG. 11 is a block diagram of a switch icon device, according to an example embodiment;
Fig. 12 is a block diagram of an electronic device for implementing a method of switching icon styles in accordance with an embodiment of the present disclosure.
Detailed Description
Exemplary embodiments of the present disclosure are described below in conjunction with the accompanying drawings, which include various details of the embodiments of the present disclosure to facilitate understanding, and should be considered as merely exemplary. Accordingly, one of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present disclosure. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
The present disclosure applies to scenes in which style switching is performed on icons (icon). The icons to which the present disclosure relates refer to icons displayed on a display interface of an electronic device. The icons displayed on the display interface may be in the format of a scalable vector graphic (scalable vector graphics, svg) or in the format of a streaming network graphic (portable network graphic, png). For ease of description, the present disclosure will be described with reference to icons in svg format.
In practical applications, in order to meet display requirements, icons with different icon styles need to be designed for different scenes. The design process not only requires more manpower to be put into design work, but also increases the resource volume during research and development. In order to solve the above-mentioned problems, the related art proposes a scheme that can transform a set of icons into various styles. Through the scheme, only one set of icons is needed to be designed, and the plurality of scenes can be met by carrying out style conversion on the set of icons. The scheme provided in the related art mainly switches styles according to whether paths (paths) constituting icons are closed paths. As shown in fig. 1a, when the path is an open path, the path can only change the tracing under different icon styles. And when the path is a closed path, as shown in fig. 1b, the path may be traced in a linear icon style and may be traced and filled simultaneously in a planar icon style.
The above scheme relies on whether the icon path is closed to switch the styles, resulting in a limitation in the scheme in switching the styles. In other words, when a path is an open path, the path is not fillable under certain styles. But in many more scenarios many open paths need to be filled in according to certain rules. Therefore, the schemes provided in the related art cannot satisfy more complex icon usage scenarios.
In view of this, the present disclosure provides a method of switching icon styles. In this method, a set of icons is required to be designed according to a preset rule. And analyzing the svg path of each icon in the set of icons to generate a canonical svg json description file. And changing the path description of the path according to the style information corresponding to the style to be switched so as to determine the corresponding path style under the style to be switched. The path description may be understood as describing a path style by a path id and a path attribute. The present disclosure completes switching of icon styles by changing path styles of path descriptions changing paths. According to the method, the icons in the set of icons are operated in batches, so that the aim of converting the set of icons into different styles according to the needs is fulfilled. According to the method, icons in different styles can be converted by changing the path description only by introducing a set of resources, so that the switching of page topics on a display interface is realized.
When designing an icon, the embodiment of the disclosure starts from a path in the icon, and defines path styles of the path under different icon styles through path ids and path attributes. And generating the icon based on the path patterns corresponding to the paths composing the icon. To facilitate batch processing, rules for designing icons are set. And designing path patterns of all paths forming the icon under different styles according to the set rules.
Path attributes in this disclosure include fill, stroker, inverse, and hide. But not limited to this, path attributes may be extended as the icon dimension is increased. The present disclosure determines path patterns by a combination of padding, stroking, anti-coloring, and/or hiding, and path ids.
When designing icons, the present disclosure designs path attributes under different icon styles for each path that makes up an icon. The disclosed embodiments are illustrated with respect to a planar icon style (also referred to as a fill icon style) and a linear icon style. Other icon styles also include a two-tone icon style, a rounded icon style, and the like. For example defining combinations of path attributes in a two-tone icon style. Besides the individual definition, the two-tone icon style or the rounded icon style can be realized by adjusting the path attribute parameter value on the basis of the planar icon style or the linear icon style. For a two-tone icon style, the trackable path may be filled with fill colors by stroking the trackable path with selected stroking colors on the basis of the area icon style. Wherein the stroking color and the filling color may be different. In addition, with respect to the two-tone icon style, it is also possible to fill a fillable path with a fill color by tracing the path with a tracing color on the basis of the linear icon style. For a rounded icon style, it is understood that different styles of corners are provided for the path of the trackable side in the icon.
Table 1 shows the rules set forth in the present disclosure. It can be seen that a unique path id is provided for each path in the same icon. Each icon style corresponds to an alternative path attribute. F characterizes fill, L characterizes strop, W characterizes inverse color, N characterizes hide in table 1.
Table 1 shows the set rules
The meaning of the rule is illustrated with the first column id, the second column planarly description, and the third column linear description shown in table 1. When designing the three columns of content of the same path, each column is connected by a separator. The separator may be "-" and "≡etc.
The path id in the first column, counting from 0, is higher the greater the number the higher the hierarchy. For example, if the number of a path is 0, this indicates that the path is displayed below all other paths.
The facial descriptions in the second column may be arbitrarily combined for F (fill), L (strop), W (inverse color), and/or N (hide). And determining the path style under the style of the area icon through the combined path attributes. For example, if the planarity of a path is described as fill+inverse, then the path may be filled in under the planeness icon style and the inverse is filled.
Linear description in the third column: the path style in the linear icon style may be determined by any combination of F (fill), L (stroked), W (reversed), and/or N (hidden). If the column is empty, it defaults to tracing.
In one embodiment, the icons are designed according to the rules, and svg files corresponding to the icons are obtained. The svg file includes "rectangle (0-F-N)", "downward arrow (1-WL-L)", "A (2-WL-L)", and "Z (3-WL-L)". The icon corresponding to the svg file is an ascending (SortAscending) icon. Fig. 2a is a style of the ascending (SortAscending) icon in a linear icon style. Fig. 2b is a style of the ascending (SortAscending) icon in the area icon style. It can be seen from the "rectangle (0-F-N)", F represents that the rectangle is fillable under the planar description, and the rectangle is set to be hidden under the linear description, so that the display and the hiding of the rectangle are controlled. That is, the present disclosure sets path styles of paths under different icon styles through path attributes.
After designing the svg icon according to the above rule, the script code first converts the svg file into the svg json description file using the parse function of svgson. The id, the face description, and the linear description of each path are read in a recursive loop, and the columns are broken down by a separator ("-"). The id, the face description, and the linear description of each path constituting the icon are parsed into path descriptions (may also be referred to as json descriptions).
In one embodiment, the svg file of "1-FW-F" is converted to an svg json description file. And analyzing the svg json description file to obtain the following path description.
{
Id:1,// Path id
Line: path description in {// Linear icon style
Line: false,// whether or not tracing is supported
And (3) filtering: true/whether or not to support tracing
Color: the default color is white
InvertColor: false,// whether or not to fill in to the inverse color
Hidden: false,// whether concealment is required
},
And (3) filtering: path description in the style of {// area icon
Line: false,// whether or not tracing is supported
And (3) filtering: true/whether or not to support tracing
Color: the default color is white
InvertColor: true// whether to fill in to reverse color
Hidden: false,// whether concealment is required
}
}
From the above description of paths, it can be known that by parsing the svg json description file, the path descriptions of the paths forming the icon in a plurality of different styles can be determined.
After the icon is designed according to the set rule, determining the path descriptions of each path forming the icon under a plurality of different styles. When the icon style is switched, each path style is determined according to the path attribute in the path description only according to style information corresponding to the style to be switched, so that the icon style switching is completed.
The following embodiments of the present disclosure will describe a method for switching icon styles with reference to the accompanying drawings.
FIG. 3 is a flow chart of a method of switching icon styles provided in accordance with an embodiment of the present disclosure; as shown in fig. 3, the method for switching icon styles provided by the present disclosure includes the following steps S301 to S304.
In step S301, a style to be switched of the icon and style information of the style to be switched are determined.
In the present disclosure, an icon style selected by a user on a display interface is determined as a style to be switched of an icon. As shown in fig. 4, an "icon style" option is provided on the display interface, and a "wire frame" option and a "fill" option are provided under the "icon style" option. The icon style corresponding to the wire frame option is a linear icon style. The icon style corresponding to the "fill" option is the area icon style. If the user is detected to select the 'line frame' option, determining that the style to be switched of the icon is a linear icon style. And if the fact that the user selects the filling option is detected, determining that the style to be switched of the icon is the facial icon style.
The style information of the style to be switched in the present disclosure includes fill color, line segment thickness, stroked color, endpoint type, inflection point type, and/or icon size, etc.
The style information of the style to be switched can be a default value or a custom value. Options for setting style information can be customized on the display interface as shown in fig. 5. Such as setting icon size, line segment thickness, endpoint type, etc. And generating different expression forms under the same icon style according to the customized style information.
In step S302, a path description of each path constituting the icon in the style to be switched is determined.
In the embodiment of the disclosure, path descriptions of paths forming the same icon in a plurality of different styles are preset. And matching the style to be switched with a plurality of different styles which are preset, and obtaining the path description corresponding to the style matched with the style to be switched. And determining the path description corresponding to the style matched with the style to be switched as the path description of each path under the style to be switched. Each path in this disclosure is a path constituting an icon.
In step S303, a path style of each path is determined based on the path attribute value in the style information and the path attribute of each path in the path description.
Assigning a path attribute value to each path in the path description based on the path attribute value in the style information, and determining the path style of each path based on the path attribute of each path after assignment.
In step S304, the icon style is switched based on the path style of each path in the icon.
The method and the device determine the path style corresponding to the path attribute of each path through the path attribute value corresponding to the to-be-switched style, and based on the path style of each path in the icon, the icon style is switched. Compared with the method for realizing icon style switching in the related art, the method for switching the icon styles does not need to mark the path attribute of the path in the icon every time the icon styles are switched, and improves the efficiency of switching the icon styles.
In any of the above embodiments, the path descriptions of the paths constituting the icon in the style to be switched are determined by parsing the description file of the icon set according to the preset rule.
FIG. 6 is a flow chart of determining a path description under a style to be switched provided in accordance with an embodiment of the present disclosure; as shown in fig. 6, the present disclosure determines a path description of each path constituting an icon in a style to be switched, including the following steps S601 to S603.
In step S601, path descriptions of paths constituting the icon under a plurality of different styles are determined.
FIG. 7 is a flow chart providing a description of a path in a particular determined style to be switched according to an embodiment of the present disclosure; as shown in fig. 7, a path description of each path constituting the icon in a plurality of different styles is determined, including the following steps S701 to S703.
In step S701, a description file of icons designed according to a preset rule is acquired.
In step S702, the description file is parsed to obtain each path constituting the icon, the ID corresponding to each path, and the path attribute of each path under a plurality of different styles.
In step S703, the IDs corresponding to the paths and the path attributes of the paths in the plurality of different styles are determined as path descriptions of the paths constituting the icon in the plurality of different styles.
The specific processes in steps S701 to S703 are described in the above embodiments, and are not described here again.
The method and the device have the advantages that by setting rules of designing icons, path styles of paths in various different styles are designed through path attributes in a design stage. The icon style switching can be more accurately realized through the path attribute of each path composing the icon. The switched icon is more in line with the preset expectations.
In step S602, for each path, a path description corresponding to a style to be switched is extracted from path descriptions in a plurality of different styles.
In step S603, the path description of each path extracted is determined as a path description of each path in the style to be switched.
The method and the device have the advantages that the path descriptions of the paths forming the icons under various different styles are preset, and after the style to be switched is determined, the speed of style switching can be improved.
In order to realize style switching of an open path, a hidden attribute is set in a design icon. And controlling the display or hiding of paths in icons under different icon styles through the hiding attribute. In other words, when the icon of the linear icon style is switched to the planar icon style, the display of the hidden path in the icon can be controlled, and the displayed path and other paths form a closed region, so that the formed closed region can be filled. Fig. 8 is a schematic diagram of styles of open paths in icons before and after style switching provided according to an embodiment of the present disclosure; as shown in fig. 8, 801a, 802a, 803a, and 804a are icon styles in a linear icon style. 801b, 802b, 803b, and 804b are icon styles in the area icon style. As can be seen from fig. 8, when the icon is switched to the planar icon style, the open path is converted to the closed path by controlling the hidden attribute of the path in the icon, and the closed path is filled in.
The process of controlling the hidden attribute of the path in the icon is as follows: after determining the path description of each path forming the icon under the to-be-switched style, traversing the path description of each path under the to-be-switched style; if the path attribute in the path description is the path to be hidden, determining the path corresponding to the path description as the path to be hidden; the path that needs to be hidden is deleted.
The method and the device have the advantages that through controlling the hidden attribute in the path attributes, the path needing to be hidden is deleted after the style to be switched is determined. On the contrary, under the style without deleting the hidden path, a closed area can be formed with the open path, so that the tracing and filling of any type of path in the linear icon style and the planar icon style are realized.
Path attributes in the present disclosure include fill, tracing, inverse coloring, and hiding, and paths of different styles are generated by combinations of fill, tracing, inverse coloring, and/or hiding, resulting in icons of different styles. For example, the path properties of a path in the linear icon style are fillable and reverse. For another example, the path attribute of the path in the area icon style is hidden, that is, it indicates that the path needs to be hidden in the area icon style.
Based on any implementation, the path attribute values include endpoint type, inflection point type, stroking color and/or line segment thickness; the path attribute is tracing; determining a path style for each path based on the path attribute value in the style information and the path attribute of each path in the path description, comprising: determining the path attribute as a tracing path in the path attributes corresponding to each path; and determining a path style corresponding to the path of the tracing based on the endpoint type, the inflection point type, the tracing color and/or the line segment thickness.
FIG. 9 is a schematic diagram of switching endpoint types in icons provided in accordance with an embodiment of the present disclosure; the right side of fig. 9 is the endpoint type of the selected different style, and the left side of fig. 9 is the icon style corresponding to the selected endpoint type. FIG. 10 is a schematic diagram of switching inflection point types in icons provided in accordance with an embodiment of the present disclosure; the right side of fig. 10 is the inflection point type selected for different styles, and the left side of fig. 10 is the icon style corresponding to the selected inflection point type. Ic_release in fig. 9 and 10 represents an icon for transmitting information.
The end point type, inflection point type, stroking color and/or line segment thickness of the path under different icon styles are set through stroking attributes. And realizing style switching of the traceable path through the tracing attribute.
On the basis of any implementation above, the path attribute value includes a fill color; the path attribute is filling; determining a path style for each path based on the path attribute value in the style information and the path attribute of each path in the path description, comprising: determining the path attribute as a filled path in the path attributes corresponding to each path; filling the filling color in the path attribute value in the closed region of the path composition; and determining the closed area filled with the filling color as a path pattern corresponding to the filled path.
The present disclosure sets whether paths under different icon styles can be filled through fill attributes. And filling the closed area formed by the paths after style switching through the filling attribute.
On the basis of any implementation above, the path attribute values include fill colors and/or stroking colors; the path attribute is reverse color; determining a path style for each path based on the path attribute value in the style information and the path attribute of each path in the path description, comprising: determining a path with the path attribute of inverse color in the path attributes corresponding to each path; switching the color of the path with the path attribute of the reverse color to a default color, or a color opposite to the filling color, or a color opposite to the tracing color; and determining the path pattern after the color switching as the path pattern corresponding to the path with the reverse color.
The inverse color properties can be best understood from fig. 2a and 2 b. For path a, the color of path a in the linear icon style is opposite to the color of path a in the planar icon style. The inverse color of all paths in this disclosure may be set to white, or may be the color opposite the fill color selected by the user, or the color opposite the stroked color. When the reverse colors of all paths are defaulted to white, it can be understood that if the design path is the reverse color of the selected path attribute, the color of the path is white. If the design path is an unselected anti-color attribute, the color of the path may be any color selected by the user.
The method and the device can rapidly switch the path colors of the paths under different icon styles through the inverse color attribute, and ensure that style switching is carried out according to expectations.
On the basis of any of the above embodiments, the path attribute values include color, endpoint type, inflection point type, and/or line segment thickness; path attributes are combinations of tracing, filling and/or reversing; determining a path style for each path based on the path attribute value in the style information and the path attribute of each path in the path description, comprising: and sequentially determining the path style of each path under the path attribute combination according to the preset path attribute priority based on the color, the endpoint type, the inflection point type and/or the line segment thickness.
The priorities of the path attributes in this disclosure are, in order, hidden, filled, stroked, and reversed.
The path styles can be enriched through the combination of the path attributes, so that the icon style switching is more flexible.
On the basis of any of the above embodiments, the path attribute value includes an icon size; switching the icon style based on the path style of each path in the icon, comprising: the icon style is switched based on the path style of each path in the icon and the icon size.
The icon size can also be adjusted in the method, and the icon style can be switched by adjusting the icon size.
In one embodiment, a new svg file corresponding to the style to be switched is obtained by integrating the style information of the style to be switched, the path description of the icon and the svg file of the icon. The path integration process comprises the following steps: and traversing the path description in the style to be switched through scanSvg functions, and deleting the path needing to be hidden. And transmitting the style information description of the style to be switched to the path description of the icon after deleting the hidden path through SETPATHSTYLE functions. The path description is then converted to a svg string by the stringify function of svgson. Furthermore, the svg character string (such as deleting useless labels, useless comments, optimizing merging paths and the like) can be optimized through the optimize function of svgo, so that an optimal svg file corresponding to the style to be switched is obtained.
Based on the same conception, the embodiment of the disclosure also provides a device for switching icon styles.
It can be appreciated that, in order to implement the above functions, the icon style switching device provided in the embodiments of the present disclosure includes a hardware structure and/or a software module that perform each function. The disclosed embodiments may be implemented in hardware or a combination of hardware and computer software, in combination with the various example elements and algorithm steps disclosed in the embodiments of the disclosure. Whether a function is implemented as hardware or computer software driven hardware depends upon the particular application and design constraints imposed on the solution. Those skilled in the art may implement the described functionality using different approaches for each particular application, but such implementation is not to be considered as beyond the scope of the embodiments of the present disclosure.
FIG. 11 is a block diagram of a switch icon device, according to an example embodiment; referring to fig. 11, the apparatus 1100 includes a first determination unit 1101, a second determination unit 1102, a path pattern determination unit 1103, and a switching unit 1104.
A first determining unit 1101, configured to determine a style to be switched of the icon, and style information of the style to be switched; a second determining unit 1102, configured to determine a path description of each path forming the icon in a style to be switched; a path style determining unit 1103 for determining a path style of each path based on the path attribute value in the style information and the path attribute of each path in the path description; a switching unit 1104 for switching the icon style based on the path style of each path in the icon.
In one embodiment, the second determining unit 1102 is configured to: determining path descriptions of paths forming the icon under a plurality of different styles; extracting path descriptions corresponding to the styles to be switched from the path descriptions in a plurality of different styles aiming at each path; and determining the extracted path description of each path as the path description of each path in the style to be switched.
In one embodiment, the second determining unit is further configured to: acquiring a description file of an icon designed according to a preset rule; analyzing the description file to obtain each path forming the icon, the ID corresponding to each path, and the path attribute of each path under various different styles, wherein the styles comprise a planar icon style and a linear icon style; and determining the ID corresponding to each path and the path attribute of each path in a plurality of different styles as path descriptions of each path forming the icon in a plurality of different styles.
In an embodiment, the second determining unit 1102 is further configured to: after determining the path description of each path forming the icon under the to-be-switched style, traversing the path description of each path under the to-be-switched style; if the path attribute in the path description is the path to be hidden, determining the path corresponding to the path description as the path to be hidden; the path that needs to be hidden is deleted.
In one embodiment, the path attribute values include endpoint type, inflection point type, stroked color, and/or line segment thickness; the path attribute is tracing; a path style determining unit 1103 for: determining the path attribute as a tracing path in the path attributes corresponding to each path; and determining a path style corresponding to the path of the tracing based on the endpoint type, the inflection point type, the tracing color and/or the line segment thickness.
In one embodiment, the path attribute value includes a fill color; the path attribute is filling; the path style determining unit 1103 is further configured to: determining the path attribute as a filled path in the path attributes corresponding to each path; filling a filling color in a closed area formed by the paths; and determining the closed area filled with the filling color as a path pattern corresponding to the filled path.
In one embodiment, the path attribute values include fill colors and/or stroking colors; the path attribute is reverse color; the path style determining unit 1103 is further configured to: determining a path with the path attribute of inverse color in the path attributes corresponding to each path; switching the color of the path with the path attribute of the reverse color to a default color, or a color opposite to the filling color, or a color opposite to the tracing color; and determining the path pattern after the color switching as the path pattern corresponding to the path with the reverse color.
In one embodiment, the path attribute values include color, endpoint type, inflection point type, and/or line segment thickness; path attributes are combinations of tracing, filling and/or reversing; the path style determining unit 1103 is further configured to: and sequentially determining the path style of each path under the path attribute combination according to the preset path attribute priority based on the color, the endpoint type, the inflection point type and/or the line segment thickness.
In one embodiment, the path attribute value includes an icon size; the path style determining unit 1103 is further configured to: the icon style is switched based on the path style of each path in the icon and the icon size.
The specific manner in which the various modules perform the operations in the apparatus of the above embodiments have been described in detail in connection with the embodiments of the method, and will not be described in detail herein.
In the technical scheme of the disclosure, the acquisition, storage, application and the like of the related user personal information all conform to the regulations of related laws and regulations, and the public sequence is not violated.
According to embodiments of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.
Fig. 12 shows a schematic block diagram of an example electronic device 1200 that can be used to implement embodiments of the present disclosure. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular telephones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the disclosure described and/or claimed herein.
As shown in fig. 12, the apparatus 1200 includes a computing unit 1201, which may perform various appropriate actions and processes according to a computer program stored in a Read Only Memory (ROM) 1202 or a computer program loaded from a storage unit 1208 into a Random Access Memory (RAM) 1203. In the RAM 1203, various programs and data required for the operation of the device 1200 may also be stored. The computing unit 1201, the ROM 1202, and the RAM 1203 are connected to each other via a bus 1204. An input/output (I/O) interface 1205 is also connected to the bus 1204.
Various components in device 1200 are connected to I/O interface 1205, including: an input unit 1206 such as a keyboard, mouse, etc.; an output unit 1207 such as various types of displays, speakers, and the like; a storage unit 1208 such as a magnetic disk, an optical disk, or the like; and a communication unit 1209, such as a network card, modem, wireless communication transceiver, etc. The communication unit 1209 allows the device 1200 to exchange information/data with other devices via a computer network, such as the internet, and/or various telecommunications networks.
The computing unit 1201 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of computing unit 1201 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital Signal Processors (DSPs), and any suitable processor, controller, microcontroller, etc. The computing unit 1201 performs the respective methods and processes described above, for example, a method of switching the icon style. For example, in some embodiments, the method of switching icon styles may be implemented as a computer software program tangibly embodied on a machine-readable medium, such as storage unit 1208. In some embodiments, part or all of the computer program may be loaded and/or installed onto device 1200 via ROM 1202 and/or communication unit 1209. When a computer program is loaded into the RAM 1203 and executed by the computing unit 1201, one or more steps of the method of switching icon styles described above may be performed. Alternatively, in other embodiments, the computing unit 1201 may be configured to perform the method of switching icon styles by any other suitable means (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuit systems, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), systems On Chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs, the one or more computer programs may be executed and/or interpreted on a programmable system including at least one programmable processor, which may be a special purpose or general-purpose programmable processor, that may receive data and instructions from, and transmit data and instructions to, a storage system, at least one input device, and at least one output device.
Program code for carrying out methods of the present disclosure may be written in any combination of one or more programming languages. These program code may be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus such that the program code, when executed by the processor or controller, causes the functions/operations specified in the flowchart and/or block diagram to be implemented. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. The machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and pointing device (e.g., a mouse or trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic input, speech input, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a background component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such background, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), and the internet.
The computer system may include a client and a server. The client and server are typically remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server may be a cloud server, a server of a distributed system, or a server incorporating a blockchain.
It should be appreciated that various forms of the flows shown above may be used to reorder, add, or delete steps. For example, the steps recited in the present disclosure may be performed in parallel or sequentially or in a different order, provided that the desired results of the technical solutions of the present disclosure are achieved, and are not limited herein.
The above detailed description should not be taken as limiting the scope of the present disclosure. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives are possible, depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present disclosure are intended to be included within the scope of the present disclosure.

Claims (15)

1. A method of switching icon styles, comprising:
Determining the style to be switched of an icon and style information of the style to be switched;
determining path descriptions of all paths forming the icon under the style to be switched;
Determining the path style of each path based on the path attribute value in the style information and the path attribute of each path in the path description;
Switching the icon style based on the path style of each path in the icon;
The determining the path description of each path forming the icon in the style to be switched comprises the following steps:
determining path descriptions of paths forming the icon in a plurality of different styles;
extracting path descriptions corresponding to the styles to be switched from the path descriptions under the multiple different styles aiming at each path;
Determining the path description of each extracted path as the path description of each path under the style to be switched;
The determining path descriptions of paths comprising the icon in a plurality of different styles includes:
acquiring a description file of the icon designed according to a preset rule;
Analyzing the description file to obtain each path forming the icon, the ID corresponding to each path and the path attribute of each path under various different styles, wherein the styles comprise a facial icon style and a linear icon style;
Determining the ID corresponding to each path and the path attribute of each path under a plurality of different styles as path descriptions of each path forming the icon under a plurality of different styles;
After determining the path description of each path forming the icon in the style to be switched, the method further comprises:
traversing the path description of each path in the style to be switched;
If the path attribute in the path description is the path to be hidden, determining the path corresponding to the path description as the path to be hidden;
and deleting the path needing to be hidden.
2. The method of claim 1, wherein the path attribute values include endpoint type, inflection point type, stroking color, and/or line segment thickness; the path attribute is a tracing;
the determining the path style of each path based on the path attribute value in the style information and the path attribute of each path in the path description comprises the following steps:
determining the path attribute as a tracing path in the path attributes corresponding to each path;
And determining a path style corresponding to the path of the tracing based on the endpoint type, the inflection point type, the tracing color and/or the line segment thickness.
3. The method of claim 1, wherein the path attribute value comprises a fill color; the path attribute is filling;
the determining the path style of each path based on the path attribute value in the style information and the path attribute of each path in the path description comprises the following steps:
Determining the path attribute as a filled path in the path attributes corresponding to each path;
Filling the filling color in a closed area formed by the paths;
and determining the closed area filled with the filling color as a path pattern corresponding to the filled path.
4. The method of claim 1, wherein the path attribute values comprise fill colors and/or stroked colors; the path attribute is reverse color;
the determining the path style of each path based on the path attribute value in the style information and the path attribute of each path in the path description comprises the following steps:
Determining a path with the path attribute of inverse color in the path attributes corresponding to each path;
Switching the color of the path with the path attribute of the reverse color to a default color, or a color opposite to the filling color, or a color opposite to the tracing color;
and determining the path pattern after the color switching as the path pattern corresponding to the path with the reverse color.
5. The method of claim 1, wherein the path attribute values include color, endpoint type, inflection point type, and/or line segment thickness; the path attributes are combinations of tracing, filling and/or inverse;
the determining the path style of each path based on the path attribute value in the style information and the path attribute of each path in the path description comprises the following steps:
And sequentially determining the path style of each path under the path attribute combination according to the preset path attribute priority based on the color, the endpoint type, the inflection point type and/or the line segment thickness.
6. The method of any of claims 1-5, wherein the path attribute value comprises an icon size;
The switching the icon style based on the path style of each path in the icon comprises:
And switching the icon style based on the path style of each path in the icon and the icon size.
7. An apparatus for switching icon styles, comprising:
The first determining unit is used for determining the style to be switched of the icon and the style information of the style to be switched;
A second determining unit, configured to determine a path description of each path constituting the icon in the style to be switched;
A path style determining unit, configured to determine a path style of each path based on a path attribute value in the style information and a path attribute of each path in a path description;
a switching unit, configured to switch the icon style based on the path style of each path in the icon;
Wherein the second determining unit is configured to:
determining path descriptions of paths forming the icon in a plurality of different styles;
extracting path descriptions corresponding to the styles to be switched from the path descriptions under the multiple different styles aiming at each path;
Determining the path description of each extracted path as the path description of each path under the style to be switched;
the second determining unit is further configured to:
acquiring a description file of the icon designed according to a preset rule;
Analyzing the description file to obtain each path forming the icon, the ID corresponding to each path and the path attribute of each path under various different styles, wherein the styles comprise a facial icon style and a linear icon style;
Determining the ID corresponding to each path and the path attribute of each path under a plurality of different styles as path descriptions of each path forming the icon under a plurality of different styles;
the second determining unit is further configured to:
after determining the path descriptions of all paths forming the icon under the to-be-switched style, traversing the path descriptions of all paths under the to-be-switched style;
If the path attribute in the path description is the path to be hidden, determining the path corresponding to the path description as the path to be hidden;
and deleting the path needing to be hidden.
8. The apparatus of claim 7, wherein the path attribute values comprise endpoint type, inflection point type, stroking color, and/or line segment thickness; the path attribute is a tracing; the path pattern determining unit is configured to:
determining the path attribute as a tracing path in the path attributes corresponding to each path;
And determining a path style corresponding to the path of the tracing based on the endpoint type, the inflection point type, the tracing color and/or the line segment thickness.
9. The apparatus of claim 7, wherein the path attribute value comprises a fill color; the path attribute is filling; the path style determining unit is further configured to:
Determining the path attribute as a filled path in the path attributes corresponding to each path;
Filling the filling color in a closed area formed by the paths;
and determining the closed area filled with the filling color as a path pattern corresponding to the filled path.
10. The apparatus of claim 7, wherein the path attribute values comprise fill colors and/or stroked colors; the path attribute is reverse color; the path style determining unit is further configured to:
Determining a path with the path attribute of inverse color in the path attributes corresponding to each path;
Switching the color of the path with the path attribute of the reverse color to a default color, or a color opposite to the filling color, or a color opposite to the tracing color;
and determining the path pattern after the color switching as the path pattern corresponding to the path with the reverse color.
11. The apparatus of claim 7, wherein the path attribute values comprise color, endpoint type, inflection point type, and/or line segment thickness; the path attributes are combinations of tracing, filling and/or inverse; the path style determining unit is further configured to:
And sequentially determining the path style of each path under the path attribute combination according to the preset path attribute priority based on the color, the endpoint type, the inflection point type and/or the line segment thickness.
12. The apparatus of any of claims 7-11, wherein the path attribute value comprises an icon size;
The path style determining unit is further configured to:
And switching the icon style based on the path style of each path in the icon and the icon size.
13. An electronic device, comprising:
at least one processor; and
A memory communicatively coupled to the at least one processor; wherein,
The memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-6.
14. A non-transitory computer readable storage medium storing computer instructions for causing the computer to perform the method of any one of claims 1-6.
15. A computer program product comprising a computer program applied to the electronic device of claim 13, which, when executed by a processor, implements the method of any of claims 1-6.
CN202210243306.4A 2022-03-11 2022-03-11 Icon style switching method, device, equipment, medium and product Active CN114780182B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210243306.4A CN114780182B (en) 2022-03-11 2022-03-11 Icon style switching method, device, equipment, medium and product

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210243306.4A CN114780182B (en) 2022-03-11 2022-03-11 Icon style switching method, device, equipment, medium and product

Publications (2)

Publication Number Publication Date
CN114780182A CN114780182A (en) 2022-07-22
CN114780182B true CN114780182B (en) 2024-05-10

Family

ID=82423090

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210243306.4A Active CN114780182B (en) 2022-03-11 2022-03-11 Icon style switching method, device, equipment, medium and product

Country Status (1)

Country Link
CN (1) CN114780182B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105373373A (en) * 2014-08-29 2016-03-02 腾讯科技(深圳)有限公司 Quick icon generation method and apparatus
CN106648622A (en) * 2016-11-25 2017-05-10 武汉斗鱼网络科技有限公司 Topic switching method of intelligent device and device
CN108196925A (en) * 2017-12-29 2018-06-22 山大地纬软件股份有限公司 A kind of multi-mode management system of more icons and implementation
CN111104117A (en) * 2019-12-17 2020-05-05 深圳前海环融联易信息科技服务有限公司 Page theme style switching method and device, electronic equipment and computer storage medium
CN111638878A (en) * 2020-04-26 2020-09-08 华为终端有限公司 Method and device for processing style of icon
CN114090160A (en) * 2021-11-23 2022-02-25 上海金仕达成括信息科技有限公司 Theme style switching method and system

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4391434B2 (en) * 2005-03-10 2009-12-24 フェリカネットワークス株式会社 Theme change system, portable communication device, server device, and computer program
CN111796896A (en) * 2020-06-29 2020-10-20 京东方科技集团股份有限公司 Theme switching method of application page and related equipment

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105373373A (en) * 2014-08-29 2016-03-02 腾讯科技(深圳)有限公司 Quick icon generation method and apparatus
CN106648622A (en) * 2016-11-25 2017-05-10 武汉斗鱼网络科技有限公司 Topic switching method of intelligent device and device
CN108196925A (en) * 2017-12-29 2018-06-22 山大地纬软件股份有限公司 A kind of multi-mode management system of more icons and implementation
CN111104117A (en) * 2019-12-17 2020-05-05 深圳前海环融联易信息科技服务有限公司 Page theme style switching method and device, electronic equipment and computer storage medium
CN111638878A (en) * 2020-04-26 2020-09-08 华为终端有限公司 Method and device for processing style of icon
CN114090160A (en) * 2021-11-23 2022-02-25 上海金仕达成括信息科技有限公司 Theme style switching method and system

Also Published As

Publication number Publication date
CN114780182A (en) 2022-07-22

Similar Documents

Publication Publication Date Title
CN112861057B (en) Page rendering method, device, equipment and storage medium based on applet
CN113792855B (en) Model training and word stock building method, device, equipment and storage medium
CN110852449B (en) Model migration method and electronic equipment
CN111757118B (en) Video transcoding processing method, device, equipment and medium
CN112818656B (en) Data difference comparison method, device, equipment, medium and computer program product
CN112561081B (en) Conversion method and device of deep learning model, electronic equipment and storage medium
CN112631588A (en) File generation method and device, electronic equipment and computer readable medium
JP7309811B2 (en) Data annotation method, apparatus, electronics and storage medium
CN113923474B (en) Video frame processing method, device, electronic equipment and storage medium
CN108399156B (en) The composition method and device of formula in a kind of pdf document
CN114780182B (en) Icon style switching method, device, equipment, medium and product
CN113552988A (en) Interface focus control method and device, electronic equipment and storage medium
CN112862934A (en) Method, apparatus, device, medium, and product for processing animation
CN112817660A (en) Method, device, equipment and storage medium for expanding small program capacity
CN115809688B (en) Model debugging method and device, electronic equipment and storage medium
CN113110874B (en) Method and apparatus for generating code structure diagram
CN114374703B (en) Cloud mobile phone information acquisition method, device, equipment and storage medium
CN113657408B (en) Method and device for determining image characteristics, electronic equipment and storage medium
CN113138760B (en) Page generation method and device, electronic equipment and medium
CN113691403B (en) Topology node configuration method, related device and computer program product
CN115544311A (en) Data analysis method and device
CN114443990A (en) URL (Uniform resource locator) normalization method and device
KR20220024227A (en) Method and related apparatus for data annotation, computer program
CN113569092B (en) Video classification method and device, electronic equipment and storage medium
CN113362428B (en) Method, apparatus, device, medium, and product for configuring color

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant