Theme generation method and device, equipment and storage medium
By detecting the background color of the web page and matching the theme color, the pop-up theme is automatically rendered, and the user visual experience problem caused by random pop-up theme colors is solved, which reduces development costs and user selection difficulty, and improves the user experience.
Patent Information
- Application Number
- CN202410932170.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-12
- Publication Date
- 2025-01-10
AI Technical Summary
The theme colors of pop-up windows are random, resulting in poor user visual experience. The existing solutions require a lot of manpower and material resources to design multiple sets of theme colors, and it is difficult for users to choose the right color, which affects the user experience.
By detecting the background color of the web page, determining its grayscale value, and matching the corresponding target theme color among the preset multiple theme colors, automatically rendering the theme that generates pop-up windows.
It realizes automatic matching of theme colors, reducing development costs and user selection difficulties, and improving user experience and visual effects.
Smart Images

Figure CN119293360A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of data processing technology, and specifically relates to a topic generation method, device, equipment and storage medium. Background Art
[0002] As users' personalized needs grow, various pop-up windows will be provided on web pages to meet users' needs. That is, pop-up windows can be used to communicate with users in real time and provide information, including collecting user information, displaying warning messages, confirming operations, providing real-time help, etc.
[0003] However, the current theme colors of pop-up windows are relatively random, resulting in a poor visual experience for users. Summary of the invention
[0004] The present application proposes a theme generation method, device, equipment and storage medium, which can solve the technical problem that the theme colors of current pop-up windows are relatively random, resulting in a poor visual experience for users.
[0005] The first embodiment of the present application proposes a topic generation method, including:
[0006] Detect the theme generation instruction for the target pop-up window and determine the background color of the web page;
[0007] Determining the grayscale value of the background color;
[0008] Determining a target theme color corresponding to the grayscale value from a plurality of preset theme colors;
[0009] The theme of the target pop-up window is generated according to the target theme color rendering.
[0010] The embodiment of the second aspect of the present application provides a theme generation device, including:
[0011] A detection module, used to detect a theme generation instruction for a target pop-up window and determine the background color of a web page;
[0012] A determination module, used to determine the grayscale value of the background color;
[0013] The determination module is further used to determine a target theme color corresponding to the grayscale value from a plurality of preset theme colors;
[0014] A rendering module is used to render and generate a theme of the target pop-up window according to the target theme color.
[0015] An embodiment of the third aspect of the present application provides a computing device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the method described in the first aspect above.
[0016] An embodiment of the fourth aspect of the present application provides a computer-readable storage medium on which a computer program is stored, and the program is executed by a processor to implement the method described in the first aspect above.
[0017] The technical solution provided in the embodiments of the present application has at least the following technical effects or advantages:
[0018] In an embodiment of the present application, a theme generation instruction for a target pop-up window is first detected, and the background color of the webpage is determined; the gray value of the background color is determined; a target theme color corresponding to the gray value is determined from a plurality of pre-set theme colors; and a theme of the target pop-up window is generated by rendering according to the target theme color. The embodiment of the present application obtains the background color of the webpage, and determines the corresponding target theme color based on the gray value corresponding to the background color, and generates the theme of the target pop-up window by rendering according to the target theme color, so that the corresponding theme color can be automatically matched.
[0019] Additional aspects and advantages of the present application will be given in part in the description below, and in part will become apparent from the description below, or will be learned through the practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] By reading the detailed description of the preferred embodiment below, various other advantages and benefits will become clear to those of ordinary skill in the art. The accompanying drawings are only used for the purpose of illustrating the preferred embodiment and are not considered to be limitations of the present application. In addition, the same reference symbols are used to represent the same components throughout the accompanying drawings.
[0021] In the attached picture:
[0022] Figure 1 A flow chart of a topic generation method provided by an embodiment of the present application is shown;
[0023] Figure 2 A schematic diagram of an interface of a target pop-up window provided by an embodiment of the present application is shown;
[0024] Figure 3 A schematic diagram of another target pop-up window interface provided by an embodiment of the present application is shown;
[0025] Figure 4 A flow chart of another topic generation method provided by an embodiment of the present application is shown;
[0026] Figure 5 A schematic diagram of the structure of a theme generation device provided by an embodiment of the present application is shown;
[0027] Figure 6 A schematic diagram of the structure of a computing device provided by an embodiment of the present application is shown;
[0028] Figure 7 A schematic diagram of a storage medium provided in an embodiment of the present application is shown. DETAILED DESCRIPTION
[0029] The exemplary embodiments of the present application will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present application are shown in the accompanying drawings, it should be understood that the present application can be implemented in various forms and should not be limited by the embodiments described herein. On the contrary, these embodiments are provided in order to enable a more thorough understanding of the present application and to fully convey the scope of the present application to those skilled in the art.
[0030] It should be noted that, unless otherwise specified, the technical terms or scientific terms used in this application should have the common meanings understood by technicians in the field to which this application belongs.
[0031] Based on the above background technology, the current pop-up window theme colors are relatively random, resulting in a poor user visual experience. The current solution is that web designers design a variety of web page background colors, developers simultaneously develop a variety of color theme styles, and place an entrance to select the theme on the front-end interface of the web page, and users can choose according to their needs.
[0032] Developing multiple sets of theme colors requires a lot of manpower, material resources and time. Each theme color needs to be carefully designed and debugged to ensure its visual effects and user experience. This will increase development costs, and may not be practical, especially for small projects or startups. As the project develops and iterates, the background color of the web page may need to be updated or modified. When there are multiple sets of theme colors, such updates or modifications will become more complicated and difficult. Although providing multiple sets of theme colors can meet the aesthetic needs of different users, too many choices may also cause users to feel confused and difficult to make decisions. Users may need to spend a lot of time picking the right color among many theme colors, which may reduce the user experience.
[0033] At present, some Internet products also have systems that develop configuration parameters for visual interfaces, and users can choose background and font colors by themselves. This seems flexible, but it actually increases the burden on users. Because not all users have professional knowledge of color matching, inappropriate color matching may occur, such as colors that are too bright or too dim, which affects the visual effect of the page and user experience. It is not a good universal solution.
[0034] In order to solve the above technical problems, the present application proposes a theme generation method, device, equipment and storage medium, which determines the background color of the web page by detecting a theme generation instruction for a target pop-up window; determines the gray value of the background color; determines the target theme color corresponding to the gray value among a plurality of pre-set theme colors; and generates the theme of the target pop-up window by rendering according to the target theme color. The embodiment of the present application obtains the background color of the web page, determines the corresponding target theme color based on the gray value corresponding to the background color, and generates the theme of the target pop-up window by rendering according to the target theme color, so that the corresponding theme color can be automatically matched.
[0035] The subject generation method of the present application can be executed by a computing device, and the computing device can be a server, such as one server, multiple servers, a server cluster, a cloud computing platform, etc. Optionally, the computing device can also be a terminal device, such as a mobile phone, a tablet computer, a game console, a portable computer, a desktop computer, an advertising machine, an all-in-one machine, etc. The present application does not limit the device type and number of the computing device.
[0036] The following describes a topic generation method, apparatus, device and storage medium proposed according to an embodiment of the present application in conjunction with the accompanying drawings.
[0037] See also Figure 1 , the method specifically comprises the following steps:
[0038] S101, detecting a theme generation instruction for a target pop-up window and determining a background color of a web page.
[0039] The target pop-up window may be a dialog box or prompt box that pops up on a web page, which is usually used to display important information, warnings, or request the user to input data.
[0040] The theme generation instruction may be triggered by receiving a display instruction for a web page, or by receiving a click operation on a pop-up window control at a preset position on the web page.
[0041] The target pop-up window can be automatically popped up when entering the web page, such as Figure 1 As shown, the operation of entering the "XX webpage" is detected, the "XX webpage" is displayed, and the target pop-up window corresponding to the "XX webpage" is displayed. The target pop-up window may have the welcome message and demand inquiry of the customer service of the "XX webpage", such as Figure 2 As shown, the customer service sends a welcome message "Welcome to XX webpage" and asks "What question do you have?" In addition, the target pop-up window also provides an input box for users to ask questions and make requests.
[0042] The target pop-up window may also be popped up when a click operation on a pop-up window control is received at a preset position on the webpage. Figure 3As shown, after displaying "XX web page", a welcome message "Welcome to XX web page" is displayed on "XX web page", a click operation is detected on the pop-up window control, and the target pop-up window is displayed. The customer service sends a welcome message "Welcome to XX web page" and a demand inquiry "What question do you have?" In addition, the target pop-up window also provides an input box for users to ask questions and make demands.
[0043] It is understandable that the background of a webpage can be composed of various colors or at least one background image. If the background of a webpage can be composed of various colors, the background color of the webpage can be determined based on the various colors. If the background of a webpage is composed of at least one background image, the background color of the webpage can be determined based on the at least one background image.
[0044] S102: Determine the grayscale value of the background color.
[0045] It is understandable that multiple theme colors can be set in advance for the target pop-up window. In order to match a suitable theme color to each background color, each theme color can correspond to a grayscale value range. Therefore, the theme color corresponding to the background color can be determined by determining the grayscale value of the background color.
[0046] In some embodiments, determining the grayscale value of the background color is achieved by converting the RGB color representation of the background color into a grayscale value. The grayscale value represents the brightness of a color in a black and white image, and is usually represented by a value between 0 and 255.
[0047] In some embodiments, determining the grayscale value of the background color can be achieved by determining the value of each component in the RGB color of the background color, and multiplying the values of the red, green, and blue components represented by the RGB color by the corresponding weight coefficients, where red is 0.2989, green is 0.5870, and blue is 0.1140. Adding the results can obtain the grayscale value of the background color.
[0048] S103: Determine a target theme color corresponding to the grayscale value from a plurality of preset theme colors.
[0049] In some embodiments, determining a target theme color corresponding to a grayscale value from a plurality of preset theme colors includes: obtaining grayscale value ranges corresponding to each of the plurality of theme colors; and determining a theme color whose grayscale value range includes the grayscale value as the target theme color.
[0050] The target pop-up window may be embedded in the webpage by a third-party plug-in, and therefore, the multiple theme colors corresponding to the target pop-up window may also be embedded in the webpage along with the third-party plug-in. In some embodiments, the theme color corresponding to the gray value range into which the gray value falls may be determined as the target theme color.
[0051] S104: Rendering a target pop-up window theme according to the target theme color.
[0052] In some embodiments, rendering the theme of the target pop-up window according to the target theme color includes:
[0053] Get the theme style embedded in the web page;
[0054] Use the target theme color to render the theme style and get the theme of the target pop-up window.
[0055] It is understandable that the theme style can also be embedded in the web page with a third-party plug-in. After determining the target theme color corresponding to the target pop-up window, the theme style embedded in the web page can be obtained, and the target theme color can be further used to render the theme style to obtain the theme of the target pop-up window.
[0056] The embodiment of the present application provides a theme generation method. In the embodiment of the present application, a theme generation instruction for a target pop-up window is first detected, and the background color of the webpage is determined; the gray value of the background color is determined; the target theme color corresponding to the gray value is determined from a plurality of pre-set theme colors; and the theme of the target pop-up window is generated by rendering according to the target theme color. The embodiment of the present application obtains the background color of the webpage, and determines the corresponding target theme color based on the gray value corresponding to the background color, and generates the theme of the target pop-up window by rendering according to the target theme color, so that the corresponding theme color can be automatically matched.
[0057] In some embodiments, determining the background color of a webpage includes:
[0058] Traversing the first tag attributes corresponding to each of the multiple tags of the webpage in order from the outer layer to the inner layer of the tag hierarchy, where the first tag attribute is the background color;
[0059] When the value of the first tag attribute of the first tag is not empty, determining whether the first tag attribute coverage size of the first tag and the size of the webpage visual interface meet a first preset ratio;
[0060] If the first tag attribute coverage size and the size of the webpage visual interface meet a first preset ratio, the traversal operation is stopped, and the background color of the webpage is determined based on the value of the first tag attribute of the first tag.
[0061] Web pages are composed of a series of HyperText Markup Language (HTML) tags. HTML is a markup language used to create the structure and content of web pages. By using different HTML tags, you can define the various parts, content and style of a web page.
[0062] It is understandable that the content contained in the tab hierarchy from the outer layer to the inner layer becomes less and less, and the size of the web page covered by the outermost tab may be larger, but not every tab will have a corresponding background color. Therefore, the first tab attribute corresponding to each of the multiple tabs of the web page is traversed in order from the outer layer to the inner layer of the tab hierarchy. If the value of the first tab is 0, it means that the background color corresponding to the tab is transparent or the tab has no background color. When the value of the first tab attribute of the first tab is not empty, it means that the tab has a corresponding background color.
[0063] The first preset ratio can be flexibly set based on actual conditions, for example, it can be 50%, 60%, etc.
[0064] It is understandable that after determining that the label corresponds to a background color, if the size covered by the background color is small, the background color will not be too obvious on the web page, and the theme color determined based on the background color may not meet the user's requirements. Therefore, it is necessary to determine the size covered by the background color, that is, to determine the first label attribute coverage size of the first label, and compare it with the size of the visual interface of the web page to determine whether the first label attribute coverage size of the first label and the size of the visual interface of the web page meet the first preset ratio.
[0065] The first tag attribute coverage size of the first tag can be determined by the two tag attributes offsetWidth and offsetHeight.
[0066] If the size covered by the first tag attribute and the size of the visual interface of the web page meet the first preset ratio, it means that the first tag has a corresponding background color, and the size covered by the background color meets the requirements, then the traversal operation is stopped and the background color of the web page is determined based on the value of the first tag attribute of the first tag.
[0067] In an embodiment of the present application, the first tag attributes corresponding to each of the multiple tags of the web page are traversed in order from the outer layer to the inner layer of the tag hierarchy, and a tag with a corresponding background color and a size covered by the background color that meets the requirements is determined, so that the background color of the web page can be determined based on the color corresponding to the tag.
[0068] In some embodiments, determining the background color of a webpage includes:
[0069] If there is no tag in the webpage whose value of the first tag attribute is not empty, or there is no tag whose coverage size of the first tag attribute and the size of the visual interface of the webpage meet the first preset ratio, then traverse the second tag attributes corresponding to each of the multiple tags in the order from the outer layer to the inner layer of the tag hierarchy, and the second tag attribute is the index of the background image;
[0070] When it is found that the size of the background image corresponding to the second tag attribute and the size of the webpage visual interface meet a second preset ratio, the traversal operation is stopped, and the background color of the webpage is determined based on the background image corresponding to the second tag attribute.
[0071] As mentioned above, the background of a web page can be composed of various colors, or it can be composed of at least one background image. If there is no tag in the web page whose value of the first tag attribute is not empty, or there is no tag whose coverage size of the first tag attribute satisfies the first preset ratio with the size of the visual interface of the web page, it means that the background of the web page is composed of at least one background image.
[0072] Furthermore, the second tag attributes corresponding to each of the multiple tags are traversed in order from the outer layer to the inner layer of the tag level, that is, the background image index corresponding to each of the multiple tags is obtained, and the corresponding background image is obtained through the background image index.
[0073] The second preset ratio may be consistent with the first preset ratio, or may be inconsistent with the first preset ratio.
[0074] After obtaining the background image corresponding to each layer of the tag in order from the outer layer to the inner layer, determine the size of the background image. When the background image size corresponding to the second tag attribute and the size of the visual interface of the web page meet the second preset ratio, determine that the background image that meets the requirements is determined, and then the background color of the web page can be determined according to the color corresponding to the background image.
[0075] In an embodiment of the present application, when the background of a web page is composed of at least one background image, the background image corresponding to each layer of the label is obtained, and when the background image meets the requirements, the background color of the web page is determined based on the color corresponding to the background image.
[0076] In some embodiments, determining the background color of the webpage based on the value corresponding to the first tag attribute of the first tag includes:
[0077] Traverse the color of each pixel corresponding to the first label;
[0078] The color with the most corresponding pixels is determined as the target color;
[0079] Determine the target color as the background color of the web page.
[0080] It can be understood that the size covered by the first label corresponds to multiple pixels, and the colors corresponding to the multiple pixels can be traversed. Further, the number of pixels corresponding to each color is counted, and the multiple pixels are sorted according to the number of pixels. The color with the most corresponding pixels is determined as the target color, and the target color is further determined as the background color of the web page.
[0081] In some embodiments, determining the background color of the webpage based on the background image corresponding to the second tag attribute includes:
[0082] Get the background image corresponding to the second tag attribute;
[0083] Use the target component to analyze the color number corresponding to the image;
[0084] The color corresponding to the color number is determined as the background color of the web page.
[0085] The target component can be a canvas API, which can draw images to <canvas>Get <canvas>The pixel data on the image is obtained, and the data is traversed to count the number of occurrences of each color. The color with the most occurrences is found and output. The color with the most occurrences is determined as the color number corresponding to the background image, and the color corresponding to the color number is further determined as the background color of the webpage.
[0086] In some embodiments, in order to describe in detail the above-mentioned method for determining the background color of a webpage based on the background image corresponding to the second tag attribute and determining the target theme color based on the background color, the embodiment of the present application also provides a flowchart of the theme generation method, such as Figure 4 As shown, the method comprises the following steps:
[0087] S401, create canvas, set the second tag attribute value, and obtain getContext.
[0088] Canvas provides a dynamic and efficient way to draw graphics and animations on web pages. It is very suitable for applications that require a lot of graphics processing, such as games, charts, data visualization, and image editing tools. After creating canvas, you can get the corresponding background image by setting the second tag attribute value, and get the context information in the background image through getContext.
[0089] S402, obtain color data of getmageData.
[0090] Among them, getimageData is used to obtain pixel data from a specific area of the canvas. It returns an ImageData object, which contains the color and transparency information of each pixel in the specified area. Therefore, getimageData can be used to obtain the color of each pixel in the background image.
[0091] S403 , traverse multiple pixels corresponding to the second label, and count the number of pixels corresponding to each color.
[0092] S404: Sort the colors according to the number of pixels.
[0093] S405: Determine the color with the most corresponding pixels as the target color.
[0094] S406: Determine the grayscale value of the target color.
[0095] The grayscale value of the target color is determined by converting the RGB color representation of the target color into a grayscale value.
[0096] S407: Determine a target theme color corresponding to the grayscale value from among a plurality of preset theme colors.
[0097] S408: Rendering generates a theme of the target pop-up window according to the target theme color.
[0098] If the background of the webpage can be composed of various colors, after determining the first tag that meets the requirements, the target theme color can also be determined according to steps S403 to S408.
[0099] The present application also provides a theme generation device, which is used to execute the theme generation method provided in any of the above embodiments. Figure 5 As shown, the device includes: a detection module 501, a determination module 502 and a rendering module 503.
[0100] Detection module 501, used to detect the theme generation instruction for the target pop-up window and determine the background color of the web page;
[0101] A determination module 502, configured to determine a grayscale value of the background color;
[0102] The determination module 502 is further configured to determine a target theme color corresponding to the grayscale value from among a plurality of preset theme colors;
[0103] The rendering module 503 is used to render and generate the theme of the target pop-up window according to the target theme color.
[0104] The embodiment of the present application provides a theme generation device. In the embodiment of the present application, a theme generation instruction for a target pop-up window is first detected, and the background color of the webpage is determined; the gray value of the background color is determined; the target theme color corresponding to the gray value is determined from a plurality of pre-set theme colors; and the theme of the target pop-up window is generated by rendering according to the target theme color. The embodiment of the present application obtains the background color of the webpage, and determines the corresponding target theme color based on the gray value corresponding to the background color, and generates the theme of the target pop-up window by rendering according to the target theme color, so that the corresponding theme color can be automatically matched.
[0105] In some embodiments, the determination module 502 is specifically configured to:
[0106] Traversing first tag attributes corresponding to each of the multiple tags of the webpage in order from the outer layer to the inner layer of the tag hierarchy, wherein the first tag attribute is background color;
[0107] When the value of the first tag attribute of the first tag is not empty, determining whether the first tag attribute coverage size of the first tag and the size of the webpage visual interface meet a first preset ratio;
[0108] If the first tag attribute coverage size and the size of the webpage visual interface meet the first preset ratio, the traversal operation is stopped, and the background color of the webpage is determined based on the value of the first tag attribute of the first tag.
[0109] In some embodiments, the determination module 502 is further specifically configured to:
[0110] If there is no tag in the webpage whose value of the first tag attribute is not empty, or there is no tag whose coverage size of the first tag attribute and the size of the visual interface of the webpage meet the first preset ratio, then traverse the second tag attributes corresponding to each of the multiple tags in order from the outer layer to the inner layer of the tag hierarchy, where the second tag attribute is the index of the background image;
[0111] When it is found that the size of the background image corresponding to the second tag attribute and the size of the visual interface of the web page meet a second preset ratio, the traversal operation is stopped, and the background color of the web page is determined based on the background image corresponding to the second tag attribute.
[0112] In some embodiments, the determination module 502 is further specifically configured to:
[0113] Traversing the color of each pixel corresponding to the first label;
[0114] The color with the most corresponding pixels is determined as the target color;
[0115] The target color is determined as the background color of the webpage.
[0116] In some embodiments, the determination module 502 is further specifically configured to:
[0117] Get the background image corresponding to the second tag attribute;
[0118] Analyze the color number corresponding to the image using the target component;
[0119] The color corresponding to the color number is determined as the background color of the webpage.
[0120] In some embodiments, the determination module 502 is specifically configured to:
[0121] Obtain the grayscale value range corresponding to each of the plurality of theme colors;
[0122] A theme color whose grayscale value range includes the grayscale value is determined as a target theme color.
[0123] In some embodiments, the rendering module 503 is specifically used to:
[0124] Obtaining a theme style embedded in the webpage;
[0125] The theme style is rendered using the target theme color to obtain the theme of the target pop-up window.
[0126] The present application also provides a computing device to execute the above-mentioned topic generation method. Figure 6 It shows a schematic diagram of a computing device provided by some embodiments of the present application. Figure 6 As shown, the computing device 7 includes: a processor 700, a memory 701, a bus 702 and a communication interface 703, and the processor 700, the communication interface 703 and the memory 701 are connected via the bus 702; the memory 701 stores a computer program that can be run on the processor 700, and when the processor 700 runs the computer program, it executes the topic generation method provided in any of the aforementioned embodiments of the present application.
[0127] The memory 701 may include a high-speed random access memory (RAM), and may also include a non-volatile memory, such as at least one disk storage. The communication connection between the device network element and at least one other network element is realized through at least one communication interface 703 (which may be wired or wireless), and the Internet, wide area network, local area network, metropolitan area network, etc. may be used.
[0128] The bus 702 may be an ISA bus, a PCI bus, or an EISA bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. The memory 701 is used to store programs, and the processor 700 executes the programs after receiving the execution instructions. The subject generation method disclosed in any implementation of the above-mentioned embodiment of the present application may be applied to the processor 700, or implemented by the processor 700.
[0129] The processor 700 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit or software instructions in the processor 700. The above processor 700 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a readily available programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present application can be implemented or executed. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in the embodiments of the present application can be directly embodied as a hardware decoding processor to be executed, or the hardware and software modules in the decoding processor can be executed. The software module can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 701, and the processor 700 reads the information in the memory 701 and completes the steps of the above method in combination with its hardware.
[0130] The computing device provided in the embodiment of the present application and the subject generation method provided in the embodiment of the present application are based on the same inventive concept and have the same beneficial effects as the methods adopted, run or implemented therein.
[0131] The present application also provides a computer-readable storage medium corresponding to the theme generation method provided in the above embodiment. Figure 7 The computer-readable storage medium shown is a CD 30 on which a computer program (ie, a program product) is stored. When the computer program is run by a processor, the subject generation method provided by any of the aforementioned embodiments will be executed.
[0132] It should be noted that examples of computer-readable storage media may also include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other optical or magnetic storage media, which are not listed here one by one.
[0133] The computer-readable storage medium provided in the above-mentioned embodiments of the present application and the subject generation method provided in the embodiments of the present application are based on the same inventive concept and have the same beneficial effects as the method adopted, run or implemented by the application program stored therein.
[0134] It should be noted that:
[0135] In the description provided herein, a large number of specific details are described. However, it is understood that the embodiments of the present application can be practiced without these specific details. In some instances, well-known structures and technologies are not shown in detail so as not to obscure the understanding of this description.
[0136] Similarly, it should be understood that in order to streamline the present application and help understand one or more of the various inventive aspects, in the above description of the exemplary embodiments of the present application, the various features of the present application are sometimes grouped together into a single embodiment, figure, or description thereof. However, the disclosed method should not be interpreted as reflecting the following schematic diagram: the claimed application requires more features than the features clearly stated in each claim. More specifically, as reflected in the claims below, the inventive aspects are less than all the features of the single embodiment disclosed above. Therefore, the claims following the specific embodiment are hereby expressly incorporated into the specific embodiment, wherein each claim itself serves as a separate embodiment of the present application.
[0137] In addition, those skilled in the art will appreciate that, although some embodiments herein include certain features included in other embodiments but not other features, the combination of features of different embodiments is meant to be within the scope of the present application and form different embodiments. For example, in the claims below, any one of the claimed embodiments may be used in any combination.
[0138] The above are only preferred specific implementations of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.< / canvas> < / canvas>
Claims
1. A topic generation method, characterized in that: include: Detect the theme generation instruction for the target pop-up window and determine the background color of the web page; Determining the grayscale value of the background color; Determining a target theme color corresponding to the grayscale value from a plurality of preset theme colors; The theme of the target pop-up window is generated according to the target theme color rendering.
2. The method according to claim 1, characterized in that Determining the background color of the webpage includes: Traversing first tag attributes corresponding to each of the multiple tags of the webpage in order from the outer layer to the inner layer of the tag hierarchy, wherein the first tag attribute is background color; When the value of the first tag attribute of the first tag is not empty, determining whether the first tag attribute coverage size of the first tag and the size of the webpage visual interface meet a first preset ratio; If the first tag attribute coverage size and the size of the webpage visual interface meet the first preset ratio, the traversal operation is stopped, and the background color of the webpage is determined based on the value of the first tag attribute of the first tag.
3. The method according to claim 2, characterized in that Determining the background color of the webpage includes: If there is no tag in the webpage whose value of the first tag attribute is not empty, or there is no tag whose coverage size of the first tag attribute and the size of the visual interface of the webpage meet the first preset ratio, then traverse the second tag attributes corresponding to each of the multiple tags in order from the outer layer to the inner layer of the tag hierarchy, where the second tag attribute is the index of the background image; When it is found that the size of the background image corresponding to the second tag attribute and the size of the visual interface of the web page meet a second preset ratio, the traversal operation is stopped, and the background color of the web page is determined based on the background image corresponding to the second tag attribute.
4. The method according to claim 2, characterized in that: The determining the background color of the webpage based on the value corresponding to the first tag attribute of the first tag includes: Traversing the color of each pixel corresponding to the first label; The color with the most corresponding pixels is determined as the target color; The target color is determined as the background color of the webpage.
5. The method according to claim 3, characterized in that: The determining the background color of the webpage based on the picture corresponding to the second tag attribute includes: Get the background image corresponding to the second tag attribute; Analyze the color number corresponding to the image using the target component; The color corresponding to the color number is determined as the background color of the webpage.
6. The method according to claim 1, characterized in that The step of determining a target theme color corresponding to the grayscale value from among a plurality of preset theme colors includes: Obtain the grayscale value range corresponding to each of the plurality of theme colors; A theme color whose grayscale value range includes the grayscale value is determined as a target theme color.
7. The method according to claim 1, characterized in that The generating the theme of the target pop-up window according to the target theme color rendering includes: Obtaining a theme style embedded in the webpage; The theme style is rendered using the target theme color to obtain the theme of the target pop-up window.
8. A theme generating device, characterized in that: include: A detection module, used to detect a theme generation instruction for a target pop-up window and determine the background color of a web page; A determination module, used to determine the grayscale value of the background color; The determination module is further used to determine a target theme color corresponding to the grayscale value from a plurality of preset theme colors; A rendering module is used to render and generate a theme of the target pop-up window according to the target theme color.
9. A computing device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: The processor runs the computer program to implement the method according to any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: The program is executed by a processor to implement the method according to any one of claims 1 to 7.