Method, device, electronic device and computer-readable medium for changing page theme color
By reading the color matching algorithm object in the client database to generate color matching information and color data objects, the theme color can be changed directly on the client, solving the problems of high operating pressure and long configuration time on the server side, and achieving faster theme skinning and color scheme configuration.
Patent Information
- Application Number
- CN202111338893.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-12
- Publication Date
- 2025-09-16
- Estimated Expiration
- 2041-11-12
AI Technical Summary
In the existing technology, when changing the theme in Web application development, the server-side operation pressure is high, resulting in long loading time and a long time to configure the color scheme.
By reading the color matching algorithm object in the client database, generating color matching information and color data objects, the theme color can be changed directly on the client to avoid interaction with the server.
The loading time of theme changes and the time to configure color schemes are shortened, reducing the load on the server.
Smart Images

Figure CN114035879B_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present disclosure relate to the field of computer technology, and more particularly to a method, device, electronic device, and computer-readable medium for changing a page theme color. Background Art
[0002] When developing web applications, front-end developers often encounter the need to re-theme their applications. A re-theme involves replacing the colors, icons, and layout of a portion of the user interface while preserving its basic structure, thereby presenting a completely new user interface. A complete web application theme often consists of multiple elements, including theme colors, theme icons, and theme layout. Currently, re-themeing is typically performed by sending a theme re-theme request to the server, which then selects the corresponding theme skin style from a skin style library and displays it on the corresponding web page.
[0003] However, the above approach usually has the following technical problems:
[0004] First, when the page has a lot of traffic, a theme reskin request is sent to the server, which puts a lot of pressure on the server and easily causes a long loading time for the theme reskin.
[0005] Second, if developers change or add a color scheme to a theme skin style, they need to modify the skin style library of the theme skin style accordingly, which results in a longer time to configure the color scheme. Summary of the Invention
[0006] The content of this disclosure is used to briefly introduce concepts that will be described in detail in the detailed description section below. The content of this disclosure is not intended to identify key features or essential features of the claimed technical solution, nor is it intended to limit the scope of the claimed technical solution.
[0007] Some embodiments of the present disclosure provide a method, apparatus, electronic device, and computer-readable medium for changing a page theme color to solve one or more of the technical problems mentioned in the background technology section above.
[0008] In a first aspect, some embodiments of the present disclosure provide a method for changing the theme color of a page, the method comprising: in response to receiving a theme color change request corresponding to a target page submitted by a user, reading a color matching algorithm object corresponding to the above theme color change request from a client database as a target color matching algorithm object, wherein the above color matching algorithm object is a pre-set algorithm object stored in the above client database that represents a change in color matching color value; generating color matching information based on the target theme color value and the above target color matching algorithm object; generating a target color data object based on the above target theme color value and the above color matching information; and changing the theme color corresponding to the above target page based on the above target color data object.
[0009] Optionally, the above-mentioned color matching information includes at least one color matching value; and the above-mentioned replacement processing of the theme color corresponding to the above-mentioned target page according to the above-mentioned target color data object includes: converting the format of each color value included in the above-mentioned target color data object into a preset format to update the above-mentioned target color data object, wherein the above-mentioned each color value includes the above-mentioned target theme color value and the above-mentioned at least one color matching value; rendering the above-mentioned target page according to the updated target color data object.
[0010] Optionally, before generating the color matching information based on the target theme color value and the target color matching algorithm object, the method further includes: in response to receiving the theme color value input by the user, converting the format of the theme color value into the target format to update the theme color value; and determining the updated theme color value as the target theme color value.
[0011] Optionally, the color matching algorithm object in the client database is obtained through the following processing steps: in response to receiving color information input by the target user, generating a color data object based on the color information, wherein the color data object includes a color type group and color values corresponding to the color types in the color type group; converting the format of each color value included in the color data object into a target format; determining the color difference between the converted color value of the target color type and the converted color value of each alternative color type in the alternative color type group to obtain a color difference value group, wherein the target color type is a color type in the color type group whose color type is the theme color, and the alternative color type group is a color type group with the theme color removed; generating a color matching algorithm object based on the alternative color type group and the color difference value group.
[0012] Optionally, the processing step further includes: storing the color matching algorithm object in the client database.
[0013] Optionally, the above method also includes: in response to receiving a color matching algorithm object modification request submitted by the target user, reading the color matching algorithm object corresponding to the color matching algorithm object modification request from the above client database as an alternative color matching algorithm object; in response to receiving modification information corresponding to the above alternative color matching algorithm object submitted by the above target user, updating the above alternative color matching algorithm object according to the above modification information to obtain an updated color matching algorithm object; and updating the alternative color matching algorithm object stored in the above client database to the above updated color matching algorithm object.
[0014] Optionally, the method further includes: in response to receiving a color matching algorithm object deletion request submitted by the target user, deleting the color matching algorithm object corresponding to the color matching algorithm object deletion request in the client database.
[0015] In a second aspect, some embodiments of the present disclosure provide a device for changing the theme color of a page, the device comprising: a reading unit, configured to, in response to receiving a theme color change request corresponding to a target page submitted by a user, read a color matching algorithm object corresponding to the above theme color change request from a client database as a target color matching algorithm object, wherein the above color matching algorithm object is a pre-set algorithm object stored in the above client database that represents a change in color matching value; a color matching information generation unit, configured to generate color matching information based on the target theme color value and the above target color matching algorithm object; a target color data object generation unit, configured to generate a target color data object based on the above target theme color value and the above color matching information; a changing unit, configured to change the theme color corresponding to the above target page according to the above target color data object.
[0016] Optionally, the replacement unit is further configured to: convert the format of each color value included in the above-mentioned target color data object into a preset format to update the above-mentioned target color data object, wherein the above-mentioned each color value includes the above-mentioned target theme color value and the above-mentioned at least one color matching value; and render the above-mentioned target page according to the updated target color data object.
[0017] Optionally, before the color information generation unit, the device also includes: a format conversion unit, configured to convert the format of the above-mentioned theme color value into a target format in response to receiving the theme color value input by the user, so as to update the above-mentioned theme color value; a color value determination unit, configured to determine the updated theme color value as the target theme color value.
[0018] Optionally, the color matching algorithm object in the client database is obtained through the following processing steps: in response to receiving color information input by the target user, generating a color data object based on the color information, wherein the color data object includes a color type group and color values corresponding to the color types in the color type group; converting the format of each color value included in the color data object into a target format; determining the color difference between the converted color value of the target color type and the converted color value of each alternative color type in the alternative color type group to obtain a color difference value group, wherein the target color type is a color type in the color type group whose color type is the theme color, and the alternative color type group is a color type group with the theme color removed; generating a color matching algorithm object based on the alternative color type group and the color difference value group.
[0019] Optionally, the processing step further includes: storing the color matching algorithm object in the client database.
[0020] Optionally, the device further includes: a color matching algorithm object reading unit, configured to, in response to receiving a color matching algorithm object modification request submitted by a target user, read the color matching algorithm object corresponding to the color matching algorithm object modification request from the above-mentioned client database as an alternative color matching algorithm object; a first updating unit, configured to, in response to receiving modification information corresponding to the above-mentioned alternative color matching algorithm object submitted by the above-mentioned target user, update the above-mentioned alternative color matching algorithm object according to the above-mentioned modification information to obtain an updated color matching algorithm object; and a second updating unit, configured to update the alternative color matching algorithm object stored in the above-mentioned client database to the above-mentioned updated color matching algorithm object.
[0021] Optionally, the apparatus further comprises: a deleting unit configured to delete the color matching algorithm object corresponding to the color matching algorithm object deletion request in the client database in response to receiving the color matching algorithm object deletion request submitted by the target user.
[0022] In a third aspect, some embodiments of the present disclosure provide an electronic device comprising: one or more processors; a storage device on which one or more programs are stored, and when the one or more programs are executed by one or more processors, the one or more processors implement the method described in any implementation of the first aspect above.
[0023] In a fourth aspect, some embodiments of the present disclosure provide a computer-readable medium having a computer program stored thereon, wherein when the program is executed by a processor, the method described in any implementation of the first aspect is implemented.
[0024] The above-described embodiments of the present disclosure have the following beneficial effects: The page theme color changing method of some embodiments of the present disclosure shortens the loading time of theme skin changes. Specifically, a common cause of long loading times for theme skin changes is that when a page has a high number of page views, a theme skin change request is sent to the server, which places a high pressure on the server and easily leads to a long loading time for the theme skin change. Based on this, the page theme color changing method of some embodiments of the present disclosure first responds to receiving a theme color change request for a target page submitted by a user, reads the color matching algorithm object corresponding to the theme color change request from a client database as a target color matching algorithm object. This allows the color scheme (color matching algorithm object) to be directly read from the client database without interacting with the server. This shortens the loading time of the theme skin change. Next, color matching information is generated based on the target theme color value and the target color matching algorithm object. This allows the color matching color information to be determined directly based on the color value change relationship between the theme color and the color matching algorithm object. Then, a target color data object is generated based on the target theme color value and the color matching information. Finally, based on the target color data object, the theme color corresponding to the target page is changed. This completes the theme change. Because the color scheme (color matching algorithm object) is read directly from the client database, no server-side interaction is required. This reduces the loading time of the theme change. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] The above and other features, advantages, and aspects of the various embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and that components and elements are not necessarily drawn to scale.
[0026] Figure 1 This is a schematic diagram of an application scenario of a method for changing a page theme color in some embodiments of the present disclosure;
[0027] Figure 2 is a flow chart of some embodiments of the method for changing the page theme color according to the present disclosure;
[0028] Figure 3 is a flowchart of some embodiments of generating a color matching algorithm object in the page theme color changing method according to the present disclosure;
[0029] Figure 4 is a flow chart of other embodiments of the method for changing the page theme color according to the present disclosure;
[0030] Figure 5 Schematic diagram of the structure of some embodiments of the device for changing the page theme color according to the present disclosure;
[0031] Figure 6 It is a structural diagram of an electronic device suitable for implementing some embodiments of the present disclosure. DETAILED DESCRIPTION
[0032] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein. On the contrary, these embodiments are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are for illustrative purposes only and are not intended to limit the scope of protection of the present disclosure.
[0033] It should also be noted that, for ease of description, only the parts related to the invention are shown in the drawings. In the absence of conflict, the embodiments and features in the embodiments of the present disclosure may be combined with each other.
[0034] It should be noted that the concepts of "first" and "second" mentioned in this disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.
[0035] It should be noted that the modifications of "one" and "multiple" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, they should be understood as "one or more".
[0036] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.
[0037] The present disclosure will be described in detail below with reference to the accompanying drawings and in conjunction with embodiments.
[0038] Figure 1 It is a schematic diagram of an application scenario of the method for changing the page theme color according to some embodiments of the present disclosure.
[0039] exist Figure 1In the application scenario, first, the computing device 101 can respond to receiving a theme color change request corresponding to a target page submitted by a user, and read the color matching algorithm object corresponding to the above theme color change request from the client database as the target color matching algorithm object 102. The above color matching algorithm object is a pre-set algorithm object that characterizes the change of color matching color values stored in the above client database. Next, the computing device 101 can generate color matching information 104 based on the target theme color value 103 and the above target color matching algorithm object 102. Then, the computing device 101 can generate a target color data object 105 based on the above target theme color value 103 and the above color matching information 104. Finally, the computing device 101 can replace the theme color corresponding to the above target page based on the above target color data object 105.
[0040] It should be noted that the computing device 101 can be either hardware or software. When the computing device is hardware, it can be implemented as a distributed cluster consisting of multiple servers or terminal devices, or as a single server or a single terminal device. When the computing device is software, it can be installed in the hardware devices listed above. It can be implemented as multiple software or software modules for providing distributed services, or as a single software or software module. No specific limitations are given here.
[0041] It should be understood that Figure 1 The number of computing devices in the embodiment is merely illustrative. Any number of computing devices may be provided according to implementation requirements.
[0042] Further references Figure 2 , showing some embodiments of the method for changing the page theme color according to the present disclosure. The method for changing the page theme color includes the following steps:
[0043] Step 201 : in response to receiving a theme color change request corresponding to a target page submitted by a user, a color matching algorithm object corresponding to the theme color change request is read from a client database as a target color matching algorithm object.
[0044] In some embodiments, the execution body of the page theme color changing method (for example Figure 1The computing device 101 shown can, in response to receiving a user-submitted request to change the theme color of a target page, read a color matching algorithm object corresponding to the theme color change request from a client database as a target color matching algorithm object. The color matching algorithm object is a pre-set algorithm object stored in the client database that represents changes in color values. The execution entity of the page theme color change method can be a front-end SDK (Software Development Kit) built on React. The front-end SDK has functions such as adding, modifying, and deleting color matching algorithm objects. The target page can be the page currently being browsed by the user. The theme color change request can be a request to change the current theme color (color scheme) of the target page to a specific color (color matching algorithm object). The client database can be the client's local storage (localStorage). The color matching algorithm object can be a data object that includes at least one color type and a color difference value that determines the color value of each color type in the at least one color type. The color format of the color value corresponding to each color type in the at least one color type can be any color format. For example, the color format of the color value can be one of the following: RGB (Red, Green, Blue) format, HEX (Hexadecimal color code) format, HSV (Hue, Saturation, Value) format, HSL (Hue, Saturation, Lightness) format. Here, the color type of the at least one color type can be a type classified according to the actual application of the color. For example, the color type can be a theme color, a similar color, a background color, etc.
[0045] In practice, in response to receiving a theme color change request corresponding to a target page submitted by a user, the execution entity may read the color matching algorithm object represented by the theme color change request from the client database as the target color matching algorithm object.
[0046] Step 202: Generate color matching information based on the target theme color value and the target color matching algorithm object.
[0047] In some embodiments, the above-mentioned execution entity can generate color matching information based on the target theme color value and the above-mentioned target color matching algorithm object. Here, the target theme color value can be the color value of the theme color input by the user and converted into the target format. Here, the target format can be a format that represents the color value as a number. For example, the target format can be HSV format or RGB format. In practice, first, the above-mentioned execution entity can determine the difference between the above-mentioned target theme color value and the color difference value corresponding to each color matching type included in the above-mentioned target color matching algorithm object, thereby generating the color matching value corresponding to the above-mentioned color matching type and obtaining a color matching value group. Then, the above-mentioned execution entity can combine and process each color type (theme color / color matching type) included in the above-mentioned target color matching algorithm object and the color value corresponding to the above-mentioned color type (target theme color value / color matching value) to generate color information and obtain a color information group. Finally, the above-mentioned execution entity can combine and process the color information groups to obtain color matching information.
[0048] Optionally, before generating the color matching information according to the target theme color value and the target color matching algorithm object, the method further includes:
[0049] The first step is, in response to receiving the theme color value input by the user, converting the format of the theme color value into the target format to update the theme color value. Here, the theme color value may refer to the color value of the theme color input by the user. Here, the target format may be a format that represents the color value as a number. For example, the target format may be HSV format or RGB format. In practice, the above-mentioned execution entity may convert the format of the theme color value into the target format (for example, HSV format) by color conversion (for example, colorsys module) to update the theme color value.
[0050] In the second step, the updated theme color value is determined as the target theme color value.
[0051] Step 203: Generate a target color data object according to the target theme color value and the color matching information.
[0052] In some embodiments, the execution subject may generate a target color data object based on the target theme color value and the color matching information. The color matching information includes at least one color matching value. In practice, the execution subject may create a target color data object with the target theme color value, the theme color corresponding to the target theme color value, at least one color matching value, and the color matching type corresponding to each color matching value as object attributes. In practice, the execution subject may instantiate the target theme color value, the theme color corresponding to the target theme color value, at least one color matching value, and the color matching type corresponding to each color matching value to generate a target color data object.
[0053] Step 204: According to the target color data object, the theme color corresponding to the target page is changed.
[0054] In some embodiments, the above-mentioned execution entity can render the area of each color type in the above-mentioned target color data object corresponding to the target page (for example, the background area of the target page) into the color represented by the color value of the above-mentioned color type to complete the replacement of the theme color corresponding to the above-mentioned target page.
[0055] In some optional implementations of some embodiments, based on the target color data object, the execution entity may change the theme color corresponding to the target page through the following steps:
[0056] The first step is to convert the format of each color value included in the target color data object into a preset format to update the target color data object. The color values include the target theme color value and the at least one color matching value. Here, the preset format can be a hexadecimal color code format.
[0057] The second step is to render the target page according to the updated target color data object.
[0058] The above-described embodiments of the present disclosure have the following beneficial effects: The page theme color changing method of some embodiments of the present disclosure shortens the loading time of theme skin changes. Specifically, a common cause of long loading times for theme skin changes is that when a page has a high number of page views, a theme skin change request is sent to the server, which places a high pressure on the server and easily leads to a long loading time for the theme skin change. Based on this, the page theme color changing method of some embodiments of the present disclosure first responds to receiving a theme color change request for a target page submitted by a user, reads the color matching algorithm object corresponding to the theme color change request from a client database as a target color matching algorithm object. This allows the color scheme (color matching algorithm object) to be directly read from the client database without interacting with the server. This shortens the loading time of the theme skin change. Next, color matching information is generated based on the target theme color value and the target color matching algorithm object. This allows the color matching color information to be determined directly based on the color value change relationship between the theme color and the color matching algorithm object. Then, a target color data object is generated based on the target theme color value and the color matching information. Finally, based on the target color data object, the theme color corresponding to the target page is changed. This completes the theme change. Because the color scheme (color matching algorithm object) is read directly from the client database, no server-side interaction is required. This reduces the loading time of the theme change.
[0059] Continue to refer Figure 3 , shows a process 300 of generating a color matching algorithm object in some embodiments of the method for changing the page theme color according to the present disclosure. The method for generating a color matching algorithm object in the method for changing the page theme color includes the following steps:
[0060] Step 301 : In response to receiving color information input by a target user, a color data object is generated based on the color information.
[0061] In some embodiments, the execution body of the page theme color changing method (for example Figure 1The computing device 101 shown in the figure can generate a color data object based on the color information received from the target user in response to the color information input. The color data object includes a color type group and a color value corresponding to the color type in the color type group. Here, the target user may refer to a R&D personnel. Here, the color information may include a theme color, a color value of the theme color, and other color matching types and color values of the color matching types. Here, the color format of the color value corresponding to the color type in the color type group may be any color format. For example, the color format of the color value may be one of the following: RGB (Red, Green, Blue) format, HEX (hexadecimal color code) format, HSV (Hue, Saturation, Value) format, HSL (Hue, Saturation, Lightness) format. Here, the color type in the color type group may be a type divided according to the actual application of the color. For example, the color type may be a theme color, a similar color, a background color, etc.
[0062] In practice, the execution entity may generate a color data object based on the color information received from the target user via the color input box component of the front-end component. Based on the color information, the execution entity may generate the color data object using various methods. For example, the execution entity may create a data object and then modify the object properties within the data object based on the color information. The execution entity may also instantiate the color information to obtain the color data object.
[0063] As an example, the color value included in the color information input by the user may be in HEX format. Thus, the color information input by the target user may be "[theme color, #5f69bd]; [similar color, #e5edff]; [background color, #3b5275]." The above execution entity may create a data object with the color information as an object attribute, thereby obtaining a color data object.
[0064] Step 302: Convert the format of each color value included in the color data object into a target format.
[0065] In some embodiments, the execution entity may convert the format of each color value included in the color data object into a target format. Here, the target format may be a format that represents the color value as a number. For example, the target format may be an HSV format or an RGB format. In practice, the execution entity may convert the format of each color value included in the color data object into a target format (e.g., an HSV format) by using a color conversion method (e.g., a colorsys module).
[0066] Thus, the formats of the color values included in the above color data object can be converted into digital formats, which facilitates the subsequent determination of the color value change relationship (color difference) between the theme color and other color combinations.
[0067] Step 303 : determining a color difference between the converted color value of the target color type and the converted color value of each candidate color type in the candidate color type group, and obtaining a color difference value group.
[0068] In some embodiments, the execution entity may determine the color difference between the converted color value of the target color type and the converted color value of each alternative color type in the alternative color type group to obtain a color difference value group. The target color type is the color type in the color type group whose color type is the theme color. The alternative color type group is the color type group without the theme color. The converted color value of the color type in the color type group whose color type is the theme color may refer to the color value converted to the target format.
[0069] As an example, taking the target format as HSV format, that is, the format of the converted color value is HSV format. For example, the converted color value of the color type of the theme color in the above color type group can be (233, 50, 74). The alternative color type in the alternative color type group can be "similar color". Here, the converted color value of the alternative color type "similar color" can be (221, 10, 100). The "233, 50, 74" in the converted color value (233, 50, 74) can be subtracted from the "221, 10, 100" in the converted color value (221, 10, 100) to obtain the color difference value (12, 40, -26).
[0070] Step 304: Generate a color matching algorithm object based on the candidate color type group and the color difference value group.
[0071] In some embodiments, the execution entity may generate a color matching algorithm object based on the candidate color type group and the color difference group. Here, the execution entity may generate the color matching algorithm object using various methods. For example, the execution entity may create a data object and then modify object properties within the data object based on the candidate color type group and the color difference group. The execution entity may also instantiate the candidate color type group and the color difference group to generate the color matching algorithm object.
[0072] As an example, the alternative color type group can be "similar color, background color". The color difference value group can be "(-15, 10, 100), (-20, 10, -30)". Among them, the alternative color type "similar color" corresponds to the color difference value "(-15, 10, 100)". The alternative color type "background color" corresponds to the color difference value "(-20, 10, -30)". The above execution entity can create a data object with the above alternative color type group and the above color difference value group as object attributes, thereby obtaining a color matching algorithm object.
[0073] Optionally, the color matching algorithm object is stored in a client database.
[0074] In some embodiments, the execution entity may store the color matching algorithm object in a client database, where the client database may refer to a local storage of the client.
[0075] In this way, the color matching algorithm object can be directly stored on the client, and when the theme is changed, there is no need to interact with the server, which shortens the loading time when the theme is changed later.
[0076] The above-described embodiments of the present disclosure have the following beneficial effects: The page theme color changing method of some embodiments of the present disclosure reduces the time required to configure a color scheme. Specifically, the long time required to configure a color scheme is due to the fact that if developers modify or add a color scheme for a theme skin style, they need to modify the skin style library for that theme skin style accordingly, resulting in a long time required to configure the color scheme. Based on this, the page theme color changing method of some embodiments of the present disclosure first generates a color data object based on the color information received from a target user in response to the color information input. The color data object includes a color type group and color values corresponding to the color types in the color type group. This facilitates the subsequent establishment of a color value change relationship between the color values of the theme color and the color values of other color types. Next, the format of each color value included in the color data object is converted to a target format. This facilitates the subsequent determination of the color difference between the color values of the theme color and the color values of other color types. The color difference between the converted color value of the target color type and the converted color value of each candidate color type in the candidate color type group is then determined to obtain a color difference value group. In this way, the color value change between the color value of the theme color and the color value of other color types can be determined. Finally, based on the above-mentioned alternative color type group and the above-mentioned color difference group, a color matching algorithm object is generated. In this way, a color matching scheme (color matching algorithm object) corresponding to the theme color can be established. Also, because the color matching algorithm object is established by relying on the color value change relationship (color difference) between the color matching and the theme color, the color value change relationship between the color matching algorithm object and the theme color can be used to construct the theme skin style later, so there is no need to modify the skin style library of the theme skin style. Thus, the time for configuring the color matching scheme is shortened.
[0077] Further references Figure 4 , showing some other embodiments of the method for changing the page theme color according to the present disclosure. The method for changing the page theme color includes the following steps:
[0078] Step 401 : in response to receiving a theme color change request corresponding to a target page submitted by a user, a color matching algorithm object corresponding to the theme color change request is read from a client database as a target color matching algorithm object.
[0079] Step 402 : Generate color matching information according to the target theme color value and the target color matching algorithm object.
[0080] Step 403: Generate a target color data object according to the target theme color value and the color matching information.
[0081] Step 404: According to the target color data object, the theme color corresponding to the target page is changed.
[0082] In some embodiments, the specific implementation of steps 401-404 and the resulting technical effects can be referred to Figure 2 The corresponding steps 201-204 in the embodiments are not described in detail here.
[0083] Step 405 : In response to receiving the color matching algorithm object modification request submitted by the target user, a color matching algorithm object corresponding to the color matching algorithm object modification request is read from the client database as an alternative color matching algorithm object.
[0084] In some embodiments, the above-mentioned execution entity may, in response to receiving a color matching algorithm object modification request submitted by a target user, read the color matching algorithm object corresponding to the color matching algorithm object modification request from the above-mentioned client database as an alternative color matching algorithm object. Here, the color matching algorithm object modification request may be a request instruction to modify a certain color matching algorithm object. Here, the color matching algorithm object may refer to a data object including at least one color type and a color difference value that determines the color value of each color type in the above-mentioned at least one color type. Here, the target user may refer to a research and development personnel. In practice, the above-mentioned execution entity may, in response to receiving a color matching algorithm object modification request submitted by a target user, read the color matching algorithm object represented by the color matching algorithm object modification request from the above-mentioned client database via a wired connection or a wireless connection as an alternative color matching algorithm object.
[0085] Step 406 : in response to receiving the modification information corresponding to the candidate color matching algorithm object submitted by the target user, update the candidate color matching algorithm object according to the modification information to obtain an updated color matching algorithm object.
[0086] In some embodiments, the execution entity may, in response to receiving modification information corresponding to the alternative color matching algorithm object submitted by the target user, update the alternative color matching algorithm object according to the modification information to obtain an updated color matching algorithm object. Here, the modification information may refer to the color type in the modified alternative color matching algorithm object or the color value corresponding to the color type. In practice, the execution entity may modify the color type or the color value corresponding to the color type in the alternative color matching algorithm object corresponding to the modification information to update the alternative color matching algorithm object and obtain an updated color matching algorithm object.
[0087] Step 407: Update the candidate color matching algorithm object stored in the client database to the updated color matching algorithm object.
[0088] In some embodiments, the execution entity may replace the candidate color matching algorithm object stored in the client database with the updated color matching algorithm object.
[0089] Optionally, in response to receiving a color matching algorithm object deletion request submitted by a target user, the color matching algorithm object corresponding to the color matching algorithm object deletion request in the client database is deleted.
[0090] In some embodiments, the execution entity may, in response to receiving a color matching algorithm object deletion request submitted by the target user, delete the color matching algorithm object corresponding to the color matching algorithm object deletion request in the client database. Here, a color matching algorithm object deletion request may refer to a request to delete a specific color matching algorithm object. In practice, the execution entity may, in response to receiving a color matching algorithm object deletion request submitted by the target user, delete the color matching algorithm object represented by the color matching algorithm object deletion request in the client database.
[0091] from Figure 4 It can be seen that with Figure 2 Compared with the description of some corresponding embodiments, Figure 4 The process 400 in some corresponding embodiments completes the modification and update of the color matching algorithm object stored in the client database.
[0092] Further references Figure 5 As an implementation of the methods shown in the above figures, the present disclosure provides some embodiments of a device for changing the theme color of a page. These device embodiments are similar to Figure 2 Corresponding to the method embodiments shown, the device can be specifically applied to various electronic devices.
[0093] like Figure 5 As shown, in some embodiments, a device 500 for changing a theme color of a page includes: a reading unit 501, a color matching information generating unit 502, a target color data object generating unit 503, and a changing unit 504. The reading unit 501 is configured to, in response to receiving a theme color changing request corresponding to a target page submitted by a user, read a color matching algorithm object corresponding to the theme color changing request from a client database as a target color matching algorithm object, wherein the color matching algorithm object is a pre-set algorithm object stored in the client database that represents a change in color matching value; the color matching information generating unit 502 is configured to generate color matching information based on the target theme color value and the target color matching algorithm object; the target color data object generating unit 503 is configured to generate a target color data object based on the target theme color value and the color matching information; and the changing unit 504 is configured to change the theme color corresponding to the target page according to the target color data object.
[0094] Optionally, the color matching information includes at least one color matching value.
[0095] Optionally, the replacement unit 504 is further configured to: convert the format of each color value included in the above-mentioned target color data object into a preset format to update the above-mentioned target color data object, wherein the above-mentioned each color value includes the above-mentioned target theme color value and the above-mentioned at least one color matching value; and render the above-mentioned target page according to the updated target color data object.
[0096] Optionally, before the color information generation unit 502, the device 500 also includes: a format conversion unit, configured to convert the format of the above-mentioned theme color value into a target format in response to receiving the theme color value input by the user, so as to update the above-mentioned theme color value; a color value determination unit, configured to determine the updated theme color value as the target theme color value.
[0097] Optionally, the color matching algorithm object in the client database is obtained through the following processing steps: in response to receiving color information input by the target user, generating a color data object based on the color information, wherein the color data object includes a color type group and color values corresponding to the color types in the color type group; converting the format of each color value included in the color data object into a target format; determining the color difference between the converted color value of the target color type and the converted color value of each alternative color type in the alternative color type group to obtain a color difference value group, wherein the target color type is a color type in the color type group whose color type is the theme color, and the alternative color type group is a color type group with the theme color removed; generating a color matching algorithm object based on the alternative color type group and the color difference value group.
[0098] Optionally, the processing step further includes: storing the color matching algorithm object in the client database.
[0099] Optionally, the device 500 also includes: a color matching algorithm object reading unit, configured to, in response to receiving a color matching algorithm object modification request submitted by a target user, read the color matching algorithm object corresponding to the color matching algorithm object modification request from the above-mentioned client database as an alternative color matching algorithm object; a first updating unit, configured to, in response to receiving modification information corresponding to the above-mentioned alternative color matching algorithm object submitted by the above-mentioned target user, update the above-mentioned alternative color matching algorithm object according to the above-mentioned modification information to obtain an updated color matching algorithm object; and a second updating unit, configured to update the alternative color matching algorithm object stored in the above-mentioned client database to the above-mentioned updated color matching algorithm object.
[0100] Optionally, the apparatus 500 further includes: a deleting unit configured to, in response to receiving a color matching algorithm object deletion request submitted by the target user, delete the color matching algorithm object corresponding to the color matching algorithm object deletion request in the client database.
[0101] It is understood that the units described in the device 500 are similar to those in the reference Figure 2 Therefore, the operations, features and beneficial effects described above for the method are also applicable to the device 500 and the units included therein, and will not be repeated here.
[0102] Reference below Figure 6 , which shows an electronic device (eg, Figure 1 The electronic devices in some embodiments of the present disclosure may include, but are not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), and fixed terminals such as digital TVs and desktop computers. Figure 6 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0103] like Figure 6 As shown, the electronic device 600 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage device 608 into a random access memory (RAM) 603. Various programs and data required for the operation of the electronic device 600 are also stored in the RAM 603. The processing device 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.
[0104] Typically, the following devices may be connected to the I / O interface 605: an input device 606 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 607 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 608 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 609. The communication device 609 may allow the electronic device 600 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 6 The electronic device 600 is shown with various devices, but it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed instead. Figure 6Each block shown in the figure may represent one device, or may represent multiple devices as needed.
[0105] In particular, according to some embodiments of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, some embodiments of the present disclosure include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes program code for executing the method shown in the flowchart. In some such embodiments, the computer program can be downloaded and installed from the network via the communication device 609, or installed from the storage device 608, or installed from the ROM 602. When the computer program is executed by the processing device 601, the above-mentioned functions defined in the method of some embodiments of the present disclosure are performed.
[0106] It should be noted that the computer-readable medium described in some embodiments of the present disclosure may be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, 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 disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In some embodiments of the present disclosure, the computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, device, or device. In some embodiments of the present disclosure, the computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries computer-readable program code. Such a propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium may be transmitted using any suitable medium, including but not limited to wires, optical cables, RF (radio frequency), etc., or any suitable combination thereof.
[0107] In some embodiments, the client and server can communicate using any currently known or future developed network protocol, such as HTTP (HyperText Transfer Protocol), and can be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.
[0108] The computer-readable medium may be included in the electronic device, or may exist independently without being installed in the electronic device. The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device: in response to receiving a theme color change request corresponding to a target page submitted by a user, reads a color matching algorithm object corresponding to the theme color change request from a client database as a target color matching algorithm object, wherein the color matching algorithm object is a pre-set algorithm object stored in the client database that represents a change in color matching value; generates color matching information based on the target theme color value and the target color matching algorithm object; generates a target color data object based on the target theme color value and the color matching information; and performs a color matching process on the theme color corresponding to the target page based on the target color data object.
[0109] Computer program code for performing the operations of some embodiments of the present disclosure may be written in one or more programming languages, or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0110] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, program segment, or a part of code, and the module, program segment, or a part of code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order than that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of the boxes in the block diagram and / or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0111] The units described in some embodiments of the present disclosure may be implemented in software or hardware. The units described may also be provided in a processor. For example, they may be described as follows: a processor including a reading unit, a color matching information generating unit, a target color data object generating unit, and a replacement unit. The names of these units do not, in some cases, constitute limitations on the units themselves. For example, the replacement unit may also be described as a "unit that updates the theme color corresponding to the target page according to the target color data object."
[0112] The functions described above herein may be performed, at least in part, by one or more hardware logic components. For example, and without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chip (SOCs), complex programmable logic devices (CPLDs), and the like.
[0113] The above description is only an illustration of some preferred embodiments of the present disclosure and the technical principles used. Those skilled in the art should understand that the scope of the invention involved in the embodiments of the present disclosure is not limited to the technical solutions formed by the specific combination of the above-mentioned technical features, but should also cover other technical solutions formed by any combination of the above-mentioned technical features or their equivalent features without departing from the above-mentioned inventive concept. For example, the above-mentioned features are replaced with (but not limited to) technical features with similar functions disclosed in the embodiments of the present disclosure.
Claims
1. A method for changing a page theme color, comprising: In response to receiving a theme color change request corresponding to a target page submitted by a user, a color matching algorithm object corresponding to the theme color change request is read from a client database as a target color matching algorithm object, wherein the color matching algorithm object is a pre-set algorithm object stored in the client database that represents a change in color matching color value, and the color matching algorithm object refers to a data object including at least one color type and a color difference value for determining the color value of each color type in the at least one color type, and the color matching algorithm object is obtained by the following processing steps: in response to receiving color information input by a target user, a color matching algorithm object is generated based on the color information. A color data object, wherein the color data object includes a color type group and color values corresponding to the color types in the color type group; converting the format of each color value included in the color data object into a target format; determining the color difference between the converted color value of the target color type and the converted color value of each alternative color type in the alternative color type group to obtain a color difference value group, wherein the target color type is a color type in the color type group whose color type is a theme color, and the alternative color type group is a color type group without the theme color; generating a color matching algorithm object based on the alternative color type group and the color difference value group; Generate color matching information according to the target theme color value and the target color matching algorithm object; Generate a target color data object according to the target theme color value and the color matching information; According to the target color data object, the theme color corresponding to the target page is changed.
2. The method according to claim 1, wherein The color matching information includes at least one color matching value; as well as The step of changing the theme color corresponding to the target page according to the target color data object includes: Converting the format of each color value included in the target color data object into a preset format to update the target color data object, wherein the each color value includes the target theme color value and the at least one color matching value; The target page is rendered according to the updated target color data object.
3. The method according to claim 1, wherein Before generating color matching information according to the target theme color value and the target color matching algorithm object, the method further includes: In response to receiving a theme color value input by a user, converting a format of the theme color value into a target format to update the theme color value; The updated theme color value is determined as the target theme color value.
4. The method according to claim 1, wherein The processing steps further include: The color matching algorithm object is stored in the client database.
5. The method according to claim 1, wherein The method further comprises: In response to receiving a color matching algorithm object modification request submitted by a target user, reading a color matching algorithm object corresponding to the color matching algorithm object modification request from the client database as an alternative color matching algorithm object; In response to receiving the modification information corresponding to the candidate color matching algorithm object submitted by the target user, updating the candidate color matching algorithm object according to the modification information to obtain an updated color matching algorithm object; The candidate color matching algorithm object stored in the client database is updated to the updated color matching algorithm object.
6. The method according to claim 1, wherein The method further comprises: In response to receiving a color matching algorithm object deletion request submitted by a target user, deleting the color matching algorithm object corresponding to the color matching algorithm object deletion request in the client database.
7. A device for changing the theme color of a page, comprising: The reading unit is configured to, in response to receiving a theme color change request corresponding to a target page submitted by a user, read a color matching algorithm object corresponding to the theme color change request from a client database as a target color matching algorithm object, wherein the color matching algorithm object is a pre-set algorithm object stored in the client database that represents a change in color matching color value, and the color matching algorithm object refers to a data object including at least one color type and a color difference value for determining the color value of each color type in the at least one color type, and the color matching algorithm object is obtained by the following processing steps: in response to receiving color information input by a target user, based on the color information , generating a color data object, wherein the color data object includes a color type group and color values corresponding to the color types in the color type group; converting the format of each color value included in the color data object into a target format; determining the color difference between the converted color value of the target color type and the converted color value of each alternative color type in the alternative color type group to obtain a color difference value group, wherein the target color type is a color type in the color type group whose color type is a theme color, and the alternative color type group is a color type group without the theme color; generating a color matching algorithm object based on the alternative color type group and the color difference value group; A color matching information generating unit is configured to generate color matching information according to a target theme color value and the target color matching algorithm object; a target color data object generating unit, configured to generate a target color data object according to the target theme color value and the color matching information; The changing unit is configured to change the theme color corresponding to the target page according to the target color data object.
8. An electronic device comprising: one or more processors; a storage device having one or more programs stored thereon; When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 6.
9. A computer-readable medium having a computer program stored thereon, wherein: When the program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Method and device for switching application program themes
CN113190152A
Data processing method and device and electronic equipment
CN113535283A