CN114780182A - Method, device, equipment, medium and product for switching icon styles - Google Patents

Method, device, equipment, medium and product for switching icon styles Download PDF

Info

Publication number
CN114780182A
CN114780182A CN202210243306.4A CN202210243306A CN114780182A CN 114780182 A CN114780182 A CN 114780182A CN 202210243306 A CN202210243306 A CN 202210243306A CN 114780182 A CN114780182 A CN 114780182A
Authority
CN
China
Prior art keywords
path
style
icon
determining
attribute
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.)
Granted
Application number
CN202210243306.4A
Other languages
Chinese (zh)
Other versions
CN114780182B (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

Images

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, particularly relates to the field of application development, and can be used in cloud service and intelligent cloud scenes. The specific implementation scheme is as follows: determining the style of the icon to be switched and the style information of the style to be switched; determining the path description of each path forming the icon under the style to be switched; 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; and switching the style of the icon 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 style to be switched so as to realize switching of the icon style. Compared with the method for realizing icon style switching in the related art, the method has the advantages that the path attribute of the path in the icon does not need to be marked when the icon style is switched every time, and the efficiency of switching the icon style is improved.

Description

Method, device, equipment, medium and product for switching icon styles
Technical Field
The disclosure relates to the technical field of computers, in particular to the field of application development, and can be used in cloud service and intelligent cloud scenes.
Background
Visual designers need to design icons of different styles according to different scenes, so that more manpower is required to be input into the design work, and the resource volume in research, development and use is increased. The related art proposes a scheme of converting 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 research personnel can convert the icons in different styles by only introducing one set of resources, so that the switching of page themes 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 a style of an icon, including: determining the style of the icon to be switched and the style information of the style to be switched; determining the path description of each path forming the icon under the style to be switched; 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; and switching the style of the icon 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 a style of an icon, 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 forming the icon under 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 style of the icon 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 device 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 having stored thereon computer instructions for causing the computer to perform the method.
According to yet another aspect of the disclosure, a computer program product is provided, comprising a computer program which, when executed by a processor, implements the method.
It should be understood that the statements in this section do not necessarily identify key or critical features of the embodiments of the present disclosure, nor do they limit the scope of the present disclosure. Other features of the present disclosure will become apparent from the following description.
Drawings
The drawings are included to provide a better understanding of the present solution and are not to be construed as limiting the present disclosure. Wherein:
FIG. 1a is a pictorial illustration of an open path provided in accordance with an embodiment of the present disclosure;
FIG. 1b is an iconic representation of a closed path provided according to an embodiment of the present disclosure;
FIG. 2a is a style diagram of ascending icons in a linear icon style according to an embodiment of the present disclosure;
FIG. 2b is a style diagram of ascending order icons in a facial icon style, provided in accordance with an embodiment of the present disclosure;
FIG. 3 is a flowchart of a method for switching icon styles provided in accordance with an embodiment of the present disclosure;
FIG. 4 is a schematic diagram illustrating a style of displayed icons on a display interface provided in accordance with an embodiment of the present disclosure;
FIG. 5 is a schematic diagram illustrating custom style information displayed 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 according to an embodiment of the present disclosure;
FIG. 7 is a flow chart of path description provided in accordance with an embodiment of the present disclosure for specifically determining a style to be switched;
FIG. 8 is a schematic diagram of styles of open paths in an icon before and after style switching 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 corner types in an icon provided in accordance with an embodiment of the present disclosure;
FIG. 11 is a block diagram illustrating a toggle icon apparatus in accordance with an exemplary embodiment;
fig. 12 is a block diagram of an electronic device for implementing a method of switching icon styles of embodiments of the present disclosure.
Detailed Description
Exemplary embodiments of the present disclosure are described below with reference to the accompanying drawings, in which various details of the embodiments of the disclosure are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those 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 disclosure. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
The present disclosure is applied to scenes where styles of icons (icons) are switched. The icons related to the present disclosure refer to icons displayed on a display interface of an electronic device. The icons displayed on the display interface can be icons in a scalable vector graphics (svg) format, and can also be icons in a streaming network graphics (png) format. For convenience of presentation, the present disclosure will be described with reference to an icon in svg format.
In practical applications, in order to meet display requirements, icons in different icon styles need to be designed for different scenes. The design process not only needs more manpower to be input into the design work, but also increases the resource volume in research and development. In order to solve the above problems, the related art proposes a scheme that can convert a set of icons into a plurality of styles. Through the scheme, only one set of icons needs to be designed, and the set of icons can meet various scenes through style transformation. The scheme provided in the related art mainly switches styles according to whether a path (path) constituting an icon is a closed path. As shown in fig. 1a, when a path is an open path, the path can only change the stroke under different icon styles. While, as shown in FIG. 1b, when the path is a closed path, the path may be stroked under a linear icon style, and in a facial icon style, both stroked and filled.
The above scheme switches styles depending on whether an icon path is closed, resulting in a limitation in switching styles. In other words, when a path is an open path, the path may not be populated in certain genres. But in more scenarios, many open paths also need to be filled according to certain rules. Therefore, the solutions provided in the related art cannot satisfy more complicated icon usage scenarios.
In view of this, the present disclosure provides a method of switching icon styles. In the method, a set of icons needs to be designed according to preset rules. And analyzing the svg path of each icon in the set of icons to generate a standard svg json description file. And changing the path description of the path according to the pattern information corresponding to the to-be-switched style so as to determine the corresponding path pattern under the to-be-switched style. Here, the path description may be understood as describing a path style by a path id and a path attribute. The present disclosure changes the path style of the path by changing the path description, thereby completing the switching of the icon style. According to the method, batch operation is carried out on the icons in the set of icons, and the purpose of converting the set of icons into different styles according to requirements is achieved. By the method, icons of different styles can be converted by changing the path description only by introducing one set of resources, so that switching of page themes on the display interface is realized.
When the icon is designed, the path style of the path under different icon styles is limited through the path id and the path attribute from the path in the icon. And generating the icon based on the path style corresponding to the paths forming the icon. To facilitate batch processing, rules for designing the icons are set. And designing the path styles of all paths forming the icon under different styles according to the set rule.
Path attributes in this disclosure include fill, stroke, reverse, and hide. But not limited to this, the path attribute may be expanded as the icon dimension is increased. The present disclosure determines path styles by a combination of padding, outlining, inversion, and/or concealment, and path ids.
When the icon is designed, the path attributes in different icon styles are designed for each path forming the icon. The disclosed embodiments are described with a facial icon style (also referred to as a fill icon style) and a linear icon style as examples. Other icon styles include a two-tone icon style, a rounded icon style, and the like. For example, defining the way the path attributes are combined in a bi-tonal icon style. Besides independent limitation, the dual-tone icon style or the rounded corner icon style can be realized by adjusting the path attribute parameter value on the basis of the facial icon style or the linear icon style. For the two-tone icon style, the tradable path can be stroked by adopting the selected stroking color on the basis of the facial icon style, and the fillable path can be filled by adopting the filling color. Wherein the stroke color and fill color may be different. In addition to the linear icon style, the two-tone icon style may be implemented by drawing a tradable path with a strodable color and filling a fillable path with a filling color. For the rounded corner icon style, it is understood that different styles of corners are provided for the traversable paths in the icon.
Table 1 shows the rules set by the present disclosure. It can be seen that each path in the same icon has a unique path id. Path attributes for selection are corresponding to each icon style. F in table 1 represents fill, L represents edge, W represents reverse, N represents hide.
Figure BDA0003543690000000051
TABLE 1 set regulation schematic table
The first column id, the second list description, and the third column linear description shown in table 1 are used as examples to illustrate the meaning of the rule. When designing the above three columns of contents of the same path, each column is connected by a separator. The separators may be "-" and "&" etc.
The path id in the first column, counting from 0, is higher in the hierarchy with larger numbers. For example, if the number of a path is 0, it indicates that the path is displayed below all other paths.
The descriptive descriptions in the second column may be any combination of F (fill), L (stroke), W (reverse), and/or N (hide). And determining the path style under the facial icon style through the combined path attributes. For example, if the surface of a path is described as fill + reverse, the surface of the path can be filled in the surface icon style, and the reverse color is filled.
Linear description in the third column: the path style under the linear icon style may be determined by any combination of F (fill), L (stroke), W (reverse), and/or N (hide). If the column is empty, the stroke is defaulted.
In one embodiment, the icons are designed according to the above rules, and then 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 (sortassigning) icon. Fig. 2a shows the style of the ascending (SortAscending) icon in the linear icon style. Fig. 2b shows the style of the ascending (SortAscending) icon in the style of a facial icon. As can be seen by the "rectangle (0-F-N)", F indicates that the rectangle is fillable under the surface description, and the rectangle is set to be hidden under the linear description, so as to control the display and the hiding of the rectangle. That is, the present disclosure sets a path style of a path under different icon styles through a path attribute.
After designing the svg icon according to the above rule, the script code first converts the svg file into an svg json description file using the pars function of svgson. The id, the planar description and the linear description of each path are read in a recursive loop and the columns are broken down by separators ("-"). The id, the planar description, and the linear description of each path constituting the icon are resolved into a path description (may also be referred to as a json description).
In one embodiment, the svg file of "1-FW-F" is converted to a svg json description file. And analyzing the svg json description file to obtain the following path description.
{
id: 1,// Path id
line: path description under the {// Linear icon Style
line: false,// whether or not stroking is supported
filling: true,// whether or not strolling is supported
color: '# 000'// default color white
invertColor: false,// filled with reverse color
Fade,// need to hide
},
filling: path description under {// facies icon style
line: false,// whether or not stroke is supported
filling: true,// whether or not stroke is supported
color: '# 000'// default color white
invertColor: true// whether the padding is inverse
Fade,// need to hide
}
}
According to the path description, the path description of each path forming the icon under various different styles can be determined by analyzing the svg json description file.
After the icons are designed according to the set rules, the path description of each path forming the icons under various different styles is determined. When the icon style is switched, each path style is determined according to the path attribute in the path description only according to the 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 explain a method of switching an icon style with reference to the accompanying drawings.
FIG. 3 is a flowchart of a method for switching icon styles provided in accordance with an embodiment of the present disclosure; as shown in fig. 3, the present disclosure provides a method for switching an icon style, including the following steps S301 to S304.
In step S301, the style to be switched of the icon and style information of the style to be switched are determined.
In the disclosure, the style of the icon selected by the user on the display interface is determined as the style of the icon to be switched. 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. And the icon style corresponding to the wire frame option is a linear icon style. The icon style corresponding to the "fill" option is a facial icon style. And if the user is detected to select the wire frame option, determining that the style of the icon to be switched is a linear icon style. And if the user is detected to select the 'filling' option, determining that the style to be switched of the icon is the facial icon style.
The style information to be switched in the present disclosure includes fill color, line segment thickness, delineation 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 self-defined value. The option of setting style information can be customized on the display interface as shown in fig. 5. For example, icon size, line segment thickness, and endpoint type are set. 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 present disclosure, path descriptions of paths constituting the same icon in a plurality of different styles are preset. And matching the style to be switched with a plurality of preset different styles to acquire the path description corresponding to the style matched with the style to be switched. And determining the obtained 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 the present 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.
And assigning a path attribute value in the path description for each path based on the path attribute value in the style information, and determining the path style of each path based on the assigned path attribute of each path.
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 style to be switched, and realize switching of the icon style based on the path style of each path in the icon. Compared with the method for realizing icon style switching in the related art, the method has the advantages that the path attribute of the path in the icon is not required to be marked when the icon style is switched every time, and the icon style switching efficiency is improved.
In any of the embodiments described above, the path description of each path constituting the icon in the style to be switched is 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 according to an embodiment of the present disclosure; as shown in fig. 6, the present disclosure determines a path description of each path constituting an icon under a style to be switched, including the following steps S601-S603.
In step S601, path descriptions of the respective paths constituting the icon in a plurality of different styles are determined.
FIG. 7 is a flow chart of path description provided in accordance with an embodiment of the present disclosure for specifically determining a style to be switched; as shown in fig. 7, determining path descriptions of the respective paths constituting the icon in a plurality of different styles includes the following steps S701 to S703.
In step S701, a description file of an icon designed according to a preset rule is acquired.
In step S702, the description file is parsed to obtain each path constituting the icon, an ID corresponding to each path, and path attributes of each path under a plurality of different styles.
In step S703, the ID corresponding to each path and the path attributes of each path in the plurality of different styles are determined as the path descriptions of each path constituting the icon in the plurality of different styles.
The specific processes in steps S701 to S703 have already been described in the above embodiments, and are not described herein again.
The method and the device have the advantages that by setting the rule for designing the icons, the path styles of the paths under various different styles are designed through the path attributes in the design stage. The icon style switching can be more accurately realized through the path attributes of all paths forming the icon. And the switched icon is more in line with the preset expectation.
In step S602, for each path, a path description corresponding to the style to be switched is extracted from among path descriptions in a plurality of different styles.
In step S603, the extracted path description of each path is determined as a path description of each path in the style to be switched.
The method and the device have the advantages that path description of each path forming the icon under various different styles is 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 the open path, the hidden attribute is set in the design icon. And controlling the display or hiding of the path in the icon under different icon styles through the hidden attribute. In other words, when the linear icon style icon is switched to the planar icon style, the path hidden in the icon may be controlled to be displayed, and the displayed path and other paths form a closed region, so that the formed closed region may be filled. FIG. 8 is a schematic diagram of styles of open paths in an icon before and after style switching according to an embodiment of the present disclosure; as shown in fig. 8, 801a, 802a, 803a, and 804a are icon styles in the linear icon style. 801b, 802b, 803b and 804b are icon styles in the facial icon style. As can be seen from fig. 8, when the open path in the icon in the linear icon style is switched to the planar icon style, the open path is converted into the closed path by controlling the hidden attribute of the path in the icon, and the closed path is filled.
The hidden attribute process of the path in the control icon comprises the following steps: 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 required to be hidden, determining the path corresponding to the path description as the path required to be hidden; paths that need to be hidden are deleted.
According to the method and the device, the hidden attribute in the path attribute is controlled, and the path needing to be hidden is deleted after the style to be switched is determined. On the contrary, under the condition that the hidden path is not required to be deleted, a closed area can be formed by the hidden path and the open path, so that the stroking and filling of any form of path under the linear icon style and the facial icon style are realized.
The path attribute in the disclosure comprises filling, drawing, reverse color and hiding, and different styles of paths are generated through the combination of filling, drawing, reverse color and/or hiding, so that different styles of icons are obtained. For example, the path attributes of a path in the linear icon style may be fillable and inverse. For another example, the path attribute of the certain path in the facial icon style is hidden, that is, the path needs to be hidden in the facial icon style.
On the basis of any implementation, the path attribute value comprises an endpoint type, an inflection point type, a stroke color and/or a line segment thickness; the path attribute is stroke; 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, wherein the determining comprises the following steps: determining the path attribute as a stroked path in the path attributes corresponding to each path; and determining a path style corresponding to the stroked path based on the endpoint type, the inflection point type, the stroked color and/or the line segment thickness.
Fig. 9 is a schematic diagram of switching endpoint types in an icon provided in accordance with an embodiment of the present disclosure; the right side of fig. 9 is an endpoint type in which a different style is selected, and the left side of fig. 9 is an icon style corresponding to the selected endpoint type. FIG. 10 is a schematic diagram of switching corner types in an icon provided in accordance with an embodiment of the present disclosure; the right side of fig. 10 is a corner type for which a different style is selected, and the left side of fig. 10 is an icon style corresponding to the selected corner type. Ic _ release in fig. 9 and 10 represents an icon for sending information.
The end point type, the inflection point type, the stroking color and/or the line segment thickness of the path under different icon styles are set through the stroking attribute. Style switching of the tradable path is realized through the stroking attribute.
On the basis of any of the above implementations, the path attribute value includes a fill color; the path attribute is padding; 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, wherein the determining comprises the following steps of: determining the path attribute as a filled path in the path attributes corresponding to each path; filling colors in the path attribute values 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.
The method sets whether paths under different icon styles can be filled through the filling attribute. And filling a closed area formed by the paths after the style switching through the filling attribute.
On the basis of any of the above implementations, the path attribute values include fill colors and/or stroke colors; the path attribute is reverse color; 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, wherein the determining comprises the following steps of: determining the path attribute as a reverse path in the path attributes corresponding to each path; switching the color of the path with the path attribute of the reverse color into a default color, or a color opposite to the filling color, or a color opposite to the stroke color; and determining the path pattern after the color is switched as a path pattern corresponding to the path with the reverse color.
The inverse properties are best understood by means of fig. 2a and 2 b. For Path A, the color of Path A in the linear icon style is the opposite of the color of Path A in the facial icon style. The reverse color of all paths in this disclosure may be set to white, or may be a color opposite to the fill color selected by the user, or a color opposite to the stroke color. When the reverse color of all paths is defined as white, it can be understood that if the designed path is the selected path with the attribute of being the reverse color, the color of the path is white. If the designed path is of the unselected reverse color attribute, the color of the path can be any color selected by the user.
The method and the device can rapidly switch the path color of the path under different icon styles through the reverse color attribute, and ensure that the style switching is carried out as expected.
On the basis of any of the above embodiments, the path attribute value includes a color, an endpoint type, an inflection point type, and/or a line segment thickness; the path attribute is a combination of delineation, filling and/or reverse color; 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, wherein the determining comprises the following steps of: 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 the present disclosure, the priority of the path attribute is, in order, hidden, filled, stroked, and reversed.
The path style 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 style of the icon based on the path style of each path in the icon, comprising: and switching the style of the icon based on the path style of each path in the icon and the size of the icon.
In the method and the device, the size of the icon can be adjusted, and the style of the icon can be switched by adjusting the size of the icon.
In one embodiment, a new svg file corresponding to the style to be switched is obtained by performing path integration on the style information of the style to be switched, the path description of the icon and the svg file of the icon. The process of path integration includes: and traversing the path description under the to-be-switched style through the scanSvg function, and deleting the path needing to be hidden. And transferring the style information description of the style to be switched to the path description of the icon after the hidden path is deleted through a setPathStyle function. And converting the path description into an svg character string through a stringiness function of svgson. Furthermore, svg character strings can be optimized through an optimize function of svgo (such as deleting useless labels, useless comments, optimizing merging paths and the like), and therefore the 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 the style of the icon.
It is understood that, in order to implement the above functions, the apparatus for switching icon styles provided by the embodiments of the present disclosure includes a hardware structure and/or a software module for performing each function. The disclosed embodiments can be implemented in hardware or a combination of hardware and computer software, in combination with the exemplary elements and algorithm steps disclosed in the disclosed embodiments. Whether a function is performed in hardware or computer software drives hardware depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present disclosure.
FIG. 11 is a block diagram illustrating a toggle icon apparatus in accordance with an exemplary 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 an 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 the style to be switched; a path style determination unit 1103, configured to determine 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 style of the icon 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 various paths forming the icon under various different styles; for each path, extracting path description corresponding to the style to be switched from path descriptions in various different styles; 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, an ID corresponding to each path and path attributes of each path under various different styles, wherein the styles comprise a facial icon style and a linear icon style; and determining the ID corresponding to each path and the path attribute of each path under various different styles as the path description of each path composing the icon under various 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 required to be hidden, determining the path corresponding to the path description as the path required to be hidden; paths that need to be hidden are deleted.
In one embodiment, the path attribute values include endpoint type, inflection type, stroke color, and/or segment thickness; the path attribute is a stroke; a path pattern determination unit 1103 for: determining the path attribute as a stroked path in the path attributes corresponding to each path; and determining a path style corresponding to the stroked path based on the endpoint type, the inflection point type, the stroked color and/or the line segment thickness.
In one embodiment, the path attribute values include fill colors; the path attribute is padding; a path pattern determination unit 1103, further configured to: determining the path attribute as a filled path in the path attributes corresponding to each path; filling colors in the 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 and/or stroke colors; the path attribute is reverse color; a path pattern determination unit 1103, further configured to: determining the path attribute as a reverse path in the path attributes corresponding to each path; switching the color of the path with the path attribute of reverse color to default color, or color opposite to the filling color, or color opposite to the stroking color; and determining the path pattern after the color is switched as a 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; the path attribute is a combination of delineation, filling and/or reverse color; a path pattern determination unit 1103, 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 end point type, the inflection point type and/or the line segment thickness.
In one embodiment, the path attribute value includes an icon size; a path pattern determination unit 1103, further configured to: and switching the style of the icon based on the path style of each path in the icon and the size of the icon.
With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
In the technical scheme of the disclosure, the acquisition, storage, application and the like of the personal information of the related user all accord with the regulations of related laws and regulations, and do not violate the good customs of the public order.
The present disclosure also provides an electronic device, a readable storage medium, and a computer program product according to embodiments of the present disclosure.
FIG. 12 shows a schematic block diagram of an example electronic device 1200, which 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 phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be examples only, and are not intended 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 can perform various appropriate actions and processes in accordance with 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 by a bus 1204. An input/output (I/O) interface 1205 is also connected to bus 1204.
Various components in the device 1200 are connected to the I/O interface 1205 including: an input unit 1206 such as a keyboard, a mouse, or the like; an output unit 1207 such as various types of displays, speakers, and the like; a storage unit 1208, such as a magnetic disk, 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 telecommunication networks.
The computing unit 1201 may be a variety of general purpose and/or special purpose processing components having processing and computing capabilities. Some examples of the 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, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, and so forth. The computing unit 1201 executes the respective methods and processes described above, such as a method of switching an icon style. For example, in some embodiments, the method of switching icon styles may be implemented as a computer software program tangibly embodied in a machine-readable medium, such as storage unit 1208. In some embodiments, part or all of a computer program may be loaded onto and/or installed onto device 1200 via ROM 1202 and/or communications unit 1209. When the computer program is loaded into RAM 1203 and executed by computing unit 1201, one or more steps of the method of switching icon style described above may be performed. Alternatively, in other embodiments, the computing unit 1201 may be configured by any other suitable means (e.g., by means of firmware) to perform the method of switching icon styles.
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuitry, Field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), system on a 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 that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
Program code for implementing the methods of the present disclosure may be written in any combination of one or more programming languages. These program codes 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 codes, when executed by the processor or controller, cause the functions/operations specified in the flowchart and/or block diagram to be performed. 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. A 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 a pointing device (e.g., a mouse or a trackball) by which a user may 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 can 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, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end 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 back-end, 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 clients and servers. A client and server are generally 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 combining a blockchain.
It should be understood that various forms of the flows shown above, reordering, adding or deleting steps, may be used. For example, the steps described in the present disclosure may be executed in parallel, sequentially, or in different orders, and are not limited herein as long as the desired results of the technical solutions disclosed in the present disclosure can be achieved.
The above detailed description should not be construed as limiting the scope of the disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made, depending on design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present disclosure should be included in the protection scope of the present disclosure.

Claims (21)

1. A method of switching icon styles, comprising:
determining the style of the icon to be switched and the style information of the style to be switched;
determining the path description of each path forming the icon under the style to be switched;
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;
and switching the style of the icon based on the path style of each path in the icon.
2. The method according to claim 1, wherein the determining a path description of each path constituting the icon under the style to be switched comprises:
determining path descriptions of various paths forming the icon under various different styles;
for each path, extracting the path description corresponding to the to-be-switched style from the path descriptions in the multiple different styles;
and determining the extracted path description of each path as the path description of each path under the style to be switched.
3. The method of claim 2, wherein said determining a path description of each path comprising said icon in a plurality of different styles comprises:
acquiring a description file of the icon designed according to a preset rule;
analyzing the description file to obtain each path forming the icon, an ID corresponding to each path and path attributes of each path under various different styles, wherein the styles comprise a facial icon style and a linear icon style;
and determining the ID corresponding to each path and the path attributes of each path under various different styles as the path description of each path composing the icon under various different styles.
4. The method according to any one of claims 1-3, after determining the path description of each path composing the icon under the style to be switched, further comprising:
traversing the path description of each path under the style to be switched;
if the path attribute in the path description is required to be hidden, determining the path corresponding to the path description as the path required to be hidden;
and deleting the path needing to be hidden.
5. The method of claim 4, wherein the path attribute values include an endpoint type, a knee type, a stroking color, and/or a line segment thickness; the path attribute is a stroke;
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:
determining the path attribute as a stroked path in the path attributes corresponding to each path;
and determining a path style corresponding to the stroked path based on the endpoint type, the inflection point type, the stroked color and/or the line segment thickness.
6. The method of claim 4, wherein the path attribute values include fill colors; the path attribute is padding;
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 includes:
determining the path attribute as a filled path in the path attributes corresponding to each path;
filling the filling color in the closed area formed by the path;
and determining the closed area filled with the filling color as a path pattern corresponding to the filled path.
7. The method of claim 4, wherein the path attribute values include fill and/or stroke colors; the path attribute is a 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 includes:
determining the path attribute as a reverse path in the path attributes corresponding to each path;
switching the color of the path with the reverse path attribute into a default color, or a color opposite to the filling color, or a color opposite to the stroke color;
and determining the path pattern after the color is switched as a path pattern corresponding to the path with the reverse color.
8. The method of claim 4, wherein the path attribute values include color, endpoint type, inflection type, and/or line segment thickness; the path attribute is a combination of delineation, filling and/or 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:
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.
9. The method of any of claims 1-8, wherein the path attribute value comprises an icon size;
the switching the style of the icon based on the path style of each path in the icon includes:
and switching the style of the icon based on the path style of each path in the icon and the size of the icon.
10. An apparatus for switching a style of an icon, 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 forming the icon under 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 style of the icon based on the path style of each path in the icon.
11. The apparatus of claim 10, wherein the second determining unit is configured to:
determining path descriptions of various paths forming the icon under various different styles;
extracting a path description corresponding to the style to be switched from the path descriptions under the plurality of different styles aiming at each path;
and determining the extracted path description of each path as the path description of each path under the to-be-switched style.
12. The apparatus of claim 11, wherein 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, an ID corresponding to each path and path attributes of each path under various different styles, wherein the styles comprise a facial icon style and a linear icon style;
and determining the ID corresponding to each path and the path attributes of each path under various different styles as the path description of each path composing the icon under various different styles.
13. The apparatus according to any one of claims 10-12, wherein the second determining unit 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 required to be hidden, determining the path corresponding to the path description as the path required to be hidden;
and deleting the path needing to be hidden.
14. The apparatus of claim 13, wherein the path attribute values comprise an endpoint type, a knee type, a stroking color, and/or a line segment thickness; the path attribute is a stroke; the path pattern determination unit is configured to:
determining the path attribute as a stroked path in the path attributes corresponding to each path;
and determining a path pattern corresponding to the stroked path based on the endpoint type, the inflection point type, the stroked color and/or the line segment thickness.
15. The apparatus of claim 13, wherein the path attribute values comprise fill colors; the path attribute is padding; the path pattern 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 the closed area formed by the path;
and determining the closed area filled with the filling color as a path pattern corresponding to the filled path.
16. The apparatus of claim 13, wherein the path attribute values comprise fill and/or stroke colors; the path attribute is a reverse color; the path pattern determination unit is further configured to:
determining the path attribute as a reverse path in the path attributes corresponding to each path;
switching the color of the path with the path attribute of reverse color to a default color, or a color opposite to the filling color, or a color opposite to the stroking color;
and determining the path pattern after the color is switched as a path pattern corresponding to the path with the reverse color.
17. The apparatus of claim 13, wherein the path attribute values comprise color, endpoint type, inflection type, and/or line segment thickness; the path attribute is a combination of delineation, filling and/or reverse; the path pattern determination 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.
18. The apparatus of any of claims 10-17, wherein the path attribute value comprises an icon size;
the path pattern determining unit is further configured to:
and switching the style of the icon based on the path style of each path in the icon and the size of the icon.
19. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
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-9.
20. A non-transitory computer readable storage medium having stored thereon computer instructions for causing the computer to perform the method of any one of claims 1-9.
21. A computer program product comprising a computer program which, when executed by a processor, implements the method according to any one of claims 1-9.
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 true CN114780182A (en) 2022-07-22
CN114780182B 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 (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060206590A1 (en) * 2005-03-10 2006-09-14 Felica Networks, Inc Theme change system, portable communication device, server apparatus, and computer program
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
US20210405858A1 (en) * 2020-06-29 2021-12-30 Boe Technology Group Method for switching theme of application and electronic device
CN114090160A (en) * 2021-11-23 2022-02-25 上海金仕达成括信息科技有限公司 Theme style switching method and system

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060206590A1 (en) * 2005-03-10 2006-09-14 Felica Networks, Inc Theme change system, portable communication device, server apparatus, and computer program
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
US20210405858A1 (en) * 2020-06-29 2021-12-30 Boe Technology Group Method for switching theme of application and electronic device
CN114090160A (en) * 2021-11-23 2022-02-25 上海金仕达成括信息科技有限公司 Theme style switching method and system

Also Published As

Publication number Publication date
CN114780182B (en) 2024-05-10

Similar Documents

Publication Publication Date Title
CN113792854B (en) Model training and word stock building method, device, equipment and storage medium
CN108958736A (en) Page generation method, device, electronic equipment and computer-readable medium
US20220148239A1 (en) Model training method and apparatus, font library establishment method and apparatus, device and storage medium
CN112818656B (en) Data difference comparison method, device, equipment, medium and computer program product
KR20220034081A (en) Method for training adversarial network, method for establishing character library, apparatus and device
CN112633691A (en) Method and device for generating custom approval process
Kong et al. Web interface interpretation using graph grammars
CN112561081B (en) Conversion method and device of deep learning model, electronic equipment and storage medium
JP2023541527A (en) Deep learning model training method and text detection method used for text detection
CN114218889A (en) Document processing method, document model training method, document processing device, document model training equipment and storage medium
JP2023547010A (en) Model training methods, equipment, and electronics based on knowledge distillation
US20230047748A1 (en) Method of fusing image, and method of training image fusion model
KR102360271B1 (en) Methods and devices for determining the color of a text
JP7309811B2 (en) Data annotation method, apparatus, electronics and storage medium
CN112860366B (en) System and method for realizing remote desktop information transmission based on pattern recognition technology
CN108399156B (en) The composition method and device of formula in a kind of pdf document
CN112308939B (en) Image generation method and device
CN114780182B (en) Icon style switching method, device, equipment, medium and product
CN115809688B (en) Model debugging method and device, electronic equipment and storage medium
WO2020121678A1 (en) Mini-batch learning device, operating program for mini-batch learning device, operating method for mini-batch learning device, and image processing device
CN113110874B (en) Method and apparatus for generating code structure diagram
CN113657408B (en) Method and device for determining image characteristics, electronic equipment and storage medium
CN109726382B (en) Typesetting method and device
CN114091686A (en) Data processing method and device, electronic equipment and storage medium
CN113569092B (en) Video classification method and device, electronic equipment and storage medium

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