CN111722898A - Configuration method, device and equipment for character color in status bar - Google Patents

Configuration method, device and equipment for character color in status bar Download PDF

Info

Publication number
CN111722898A
CN111722898A CN202010454094.5A CN202010454094A CN111722898A CN 111722898 A CN111722898 A CN 111722898A CN 202010454094 A CN202010454094 A CN 202010454094A CN 111722898 A CN111722898 A CN 111722898A
Authority
CN
China
Prior art keywords
page
module
color
modules
visual
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202010454094.5A
Other languages
Chinese (zh)
Other versions
CN111722898B (en
Inventor
张莹
钱鸿强
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Koubei Shanghai Information Technology Co Ltd
Original Assignee
Koubei Shanghai Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Koubei Shanghai Information Technology Co Ltd filed Critical Koubei Shanghai Information Technology Co Ltd
Priority to CN202010454094.5A priority Critical patent/CN111722898B/en
Publication of CN111722898A publication Critical patent/CN111722898A/en
Application granted granted Critical
Publication of CN111722898B publication Critical patent/CN111722898B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

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

Abstract

The application discloses a configuration method, device and equipment for the color of characters in a status bar, and relates to the technical field of computer application. The method comprises the following steps: in response to a loading request of a page, intercepting a visual image of each module in the page formed after rendering page resource data; analyzing the visual images of the modules in the page to obtain frequency components contained in the visual images of the modules in the page and main colors corresponding to the visual images of the modules in the page; when a triggering instruction of a target module in the page is detected, configuring the color of characters displayed in the status bar based on the frequency components contained in the visual image of the target module in the page and the main color corresponding to the visual image of the target module.

Description

Configuration method, device and equipment for character color in status bar
Technical Field
The present application relates to the field of computer application technologies, and in particular, to a method, an apparatus, and a device for configuring a color of a text in a status bar.
Background
In the development process of the android system, various browsing modes are often made in order to make the use of an application program interface beautiful. Some browsing modes can hide various interface operation spaces for navigation in a program content-based context, and maximize the user visual range by using the content itself through a relatively invisible interface.
Although the browsing mode can extend the page layout to the status bar when the application program is opened, so as to bring good visual experience to the user, the text color in the status bar conflicts with the page color after the page is slid to some page areas due to uncontrollable factors existing in the overall color layout of the page, so that the user cannot clearly see the text or the color in the status bar. In the prior art, a masking layer is added in a navigation bar, and then a status bar of white characters is displayed on the masking layer, so that a user can clearly see the characters in the status bar, and color incompatibility is avoided. However, due to poor permeability of the mask layer, the status bar at the top may change color after the mask layer is added, and it is necessary to adapt the color of the status bar in a time-consuming manner, so that the user experience of the page browsing mode is poor.
Disclosure of Invention
In view of this, the present application provides a method, an apparatus, and a device for configuring a color of a text in a status bar, and mainly aims to solve the problem that in the prior art, after a navigation bar is added with a cover layer, the color of the status bar needs to be adapted in a time-consuming manner, so that a user experiences a poor page browsing mode.
According to a first aspect of the present application, there is provided a method for configuring a text color in a status bar, the method comprising:
in response to a loading request of a page, intercepting a visual image of each module in the page formed after rendering page resource data;
analyzing the visual images of the modules in the page to obtain frequency components contained in the visual images of the modules in the page and main colors corresponding to the visual images of the modules in the page;
when a triggering instruction of a target module in the page is detected, configuring the color of characters displayed in the status bar based on the frequency components contained in the visual image of the target module in the page and the main color corresponding to the visual image of the target module.
In another embodiment of the present invention, the intercepting a visual image of each module in a page formed after rendering page resource data specifically includes:
setting interception parameters for a section of a page formed after rendering page resource data, wherein the interception parameters are parameters and return values of methods to be called of the intercepted section;
and if the triggering instruction of the intercepted section is detected, extracting the visual images of all modules in the page formed after rendering the page resource data according to the parameters and the return values of the calling method required by the intercepted section.
In another embodiment of the present invention, analyzing the visualized images of each module in the page to obtain the frequency components included in the visualized images of each module in the page and the main colors corresponding to the visualized images of each module in the page specifically includes:
performing Fourier transform processing on the visual images of the modules in the page to obtain frequency components contained in the visual images of the modules in the page;
and sampling pixel color values of the visual images of the modules in the page, and extracting the main colors corresponding to the visual images of the modules in the page.
In another embodiment of the present invention, the obtaining frequency components included in the visualized image of each module in the page by performing fourier transform processing on the visualized image of each module in the page specifically includes:
performing Fourier transform processing on the visual image of each module in the page to obtain a two-dimensional function of the visual image of each module in the page;
obtaining the frequency corresponding to the element in the visual image of each module in the page by calculating the amplitude of each element in the visual image of each module in the page;
and acquiring frequency components contained in the visual images of the modules in the page based on the frequencies corresponding to the elements in the visual images of the modules in the page.
In another embodiment of the present invention, the obtaining, based on frequencies corresponding to elements in the visualized images of the modules in the page, frequency components included in the visualized images of the modules in the page specifically includes:
determining the frequency distribution range corresponding to the elements in the visual image of each module in the page based on the frequency distribution range corresponding to the frequency components in the pre-configured frequency component mapping table;
and acquiring frequency components contained in the visual images of the modules in the page by counting the frequency distribution range corresponding to the elements in the visual images of the modules in the page.
In another embodiment of the present invention, the extracting, by sampling pixel color values of the visualized images of the modules in the page, the main color corresponding to the visualized image of each module in the page specifically includes:
mapping the visual images of all modules in the page into an image matrix, and acquiring pixels in the image matrix;
carrying out periodic sampling on pixels in the image according to a preset sampling interval to obtain pixel sampling points in an image matrix;
and extracting the main color corresponding to the visual image of each module in the page by performing visual color simulation on the pixel sampling points in the image matrix.
In another embodiment of the present invention, before configuring, when the trigger instruction of the target module in the page is detected, the color of the text displayed in the status bar based on the frequency component included in the visualized image of the target module in the page and the main color corresponding to the visualized image of the target module, the method further includes:
and generating a configuration table suitable for the character colors in the status bar in the page according to the frequency components contained in the visual images of the modules in the page and the main colors corresponding to the visual images of the modules in the page, wherein the configuration table records the character colors suitable for being displayed in the status bar after combining the frequency components contained in the visual images and the main colors corresponding to the visual images.
In another embodiment of the present invention, when the trigger instruction of the target module in the page is detected, configuring the color of the text displayed in the status bar based on the frequency component included in the visualized image of the target module in the page and the main color corresponding to the visualized image of the target module, specifically including:
when a trigger instruction that a target module slides to the lower part of the status bar in the page is detected, reading character colors suitable for being displayed in the status bar from the configuration table based on frequency components contained in the visual image of the target module in the page and the main colors corresponding to the visual image of the target module;
and configuring the text color displayed in the status bar to be suitable for the text color displayed in the status bar.
According to a second aspect of the present application, an apparatus for configuring a color of a character in a status bar, the apparatus comprises:
the intercepting unit is used for responding to a loading request of the page and intercepting a visual image of each module in the page formed after rendering the page resource data;
the analysis unit is used for analyzing the visual images of the modules in the page to acquire frequency components contained in the visual images of the modules in the page and main colors corresponding to the visual images of the modules in the page;
and the configuration unit is used for configuring the character color displayed in the status bar based on the frequency component contained in the visual image of the target module in the page and the main color corresponding to the visual image of the target module when the trigger instruction of the target module in the page is detected.
In another embodiment of the present invention, the intercepting unit includes:
the setting module is used for setting interception parameters for a section of a page formed after rendering page resource data, wherein the interception parameters are parameters and return values of methods to be called by the intercepted section;
and the extraction module is used for extracting the visual images of all modules in the page formed after rendering the page resource data according to the parameters and the return values of the calling method required by the intercepted tangent plane if the triggering instruction of the intercepted tangent plane is detected.
In another embodiment of the present invention, the analysis unit includes:
the processing module is used for performing Fourier transform processing on the visual images of the modules in the page to obtain frequency components contained in the visual images of the modules in the page;
and the sampling module is used for sampling pixel color values of the visual images of all the modules in the page and extracting the corresponding main colors of the visual images of all the modules in the page.
In another embodiment of the present invention, the processing module includes:
the processing submodule is used for carrying out Fourier transform processing on the visual image of each module in the page to obtain a two-dimensional function of the visual image of each module in the page;
the calculation submodule is used for calculating the amplitude of each element in the visual image of each module in the page to obtain the frequency corresponding to the element in the visual image of each module in the page;
and the obtaining sub-module is used for obtaining frequency components contained in the visual images of the modules in the page based on the frequencies corresponding to the elements in the visual images of the modules in the page.
In another embodiment of the present invention, the obtaining sub-module is specifically configured to determine, based on a frequency distribution range corresponding to a frequency component in a pre-configured frequency component mapping table, a frequency distribution range corresponding to an element in a visual image of each module in a page;
and the obtaining sub-module is specifically configured to obtain frequency components included in the visual image of each module in the page by counting a frequency distribution range corresponding to an element in the visual image of each module in the page.
In another embodiment of the present invention, the sampling module includes:
the mapping submodule is used for mapping the visual images of all the modules in the page into an image matrix and acquiring pixels in the image matrix;
the sampling submodule is used for carrying out periodic sampling on pixels in the image according to a preset sampling interval to obtain pixel sampling points in an image matrix;
and the extraction sub-module is used for extracting the main color corresponding to the visual image of each module in the page by performing visual color simulation on the pixel sampling points in the image matrix.
In another embodiment of the present invention, the apparatus further comprises:
and a generating unit, configured to, when the trigger instruction of the target module in the page is detected, generate a configuration table applicable to colors of characters in a status bar in the page according to the frequency components included in the visualized images of the modules in the page and the main colors corresponding to the visualized images of the modules in the page before configuring the colors of the characters displayed in the status bar, where the configuration table records the colors of the characters applicable to display in the status bar after combining the frequency components included in the visualized images and the main colors corresponding to the visualized images.
In another embodiment of the present invention, the configuration unit includes:
the reading module is used for reading the character color suitable for being displayed in the status bar from the configuration table based on the frequency component contained in the visual image of the target module in the page and the main color corresponding to the visual image of the target module when the triggering instruction that the target module slides to the lower part of the status bar in the page is detected;
and the configuration module is used for configuring the character color displayed in the status bar into the character color suitable for being displayed in the status bar.
According to a third aspect of the present application, there is provided a storage medium having stored thereon a computer program which, when executed by a processor, implements the above method of configuring the color of text in a status bar.
According to a fourth aspect of the present application, there is provided a device for configuring a color of a character in a status bar, including a storage medium, a processor, and a computer program stored on the storage medium and executable on the processor, where the processor implements a method for configuring a color of a character in the status bar when executing the computer program.
By means of the technical scheme, compared with the mode of configuring the character color in the page status bar by adding a covering layer in the navigation bar in the existing mode, the method, the device and the equipment for configuring the character color in the status bar intercept visual images of all modules in a page formed by rendering page resource data in response to a loading request of the page, analyze frequency components contained in the visual images of all modules in the page and main colors corresponding to the visual images of all modules in the page so as to determine the color change condition corresponding to the visual images of all modules in the page, automatically adapt the character color displayed in the status bar according to the color change condition corresponding to the visual images of all modules in the page when a trigger instruction of a target module in the page is detected, therefore, the most suitable status bar is displayed, and the user experience of the page browsing mode is improved.
The foregoing description is only an overview of the technical solutions of the present application, and the present application can be implemented according to the content of the description in order to make the technical means of the present application more clearly understood, and the following detailed description of the present application is given in order to make the above and other objects, features, and advantages of the present application more clearly understandable.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the application and together with the description serve to explain the application and not to limit the application. In the drawings:
fig. 1 is a schematic flowchart illustrating a method for configuring text colors in a status bar according to an embodiment of the present application;
FIG. 2 is a flow chart illustrating another method for configuring text color in a status bar according to an embodiment of the present disclosure;
FIG. 3 is a schematic structural diagram illustrating an apparatus for configuring color of characters in a status bar according to an embodiment of the present application;
fig. 4 is a schematic structural diagram illustrating another configuration apparatus for text color in a status bar according to an embodiment of the present application.
Detailed Description
The present application will be described in detail below with reference to the accompanying drawings in conjunction with embodiments. It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict.
In general, when the browsing mode with the immersion effect is switched to, the system can automatically hide the status bar and the navigation bar of the system in the process that a user browses the application program page, so that the page content of the application program can be presented within the maximum display range, and the user experience is increased. In the process of configuring the color of the characters in the current status bar, a covering layer is added in the navigation bar, and then the status bar with white characters is displayed on the covering layer, so that a user can see the characters in the status bar clearly, and the color incompatibility is avoided. However, due to poor permeability of the mask layer, the status bar at the top may change color after the mask layer is added, and it is necessary to adapt the color of the status bar in a time-consuming manner, so that the user experience of the page browsing mode is poor.
In order to solve the problem, the present embodiment provides a method for configuring the color of a character in a status bar, as shown in fig. 1, including the following steps:
101. and in response to the loading request of the page, intercepting a visual image of each module in the page formed after rendering the page resource data.
The loading request of the page can be a page loading behavior triggered by a user accessing the page after switching the browsing mode, for example, in order to improve the page browsing experience of the user, a browsing mode capable of achieving an immersive effect is added to many browsers, so that after the user switches to the browsing mode, the whole page can be pushed to a system status bar when the page is opened, and the visual effect of page display is improved. However, since the page structures are different, in order to extend the page layout to the status bar, the color of the status bar corresponding to the page in the browsing mode that can achieve the immersive effect needs to be considered as the color of the entire page area, so that the display of the status bar in the page in the browsing mode needs to be set in combination with the page structures, thereby improving the experience effect of the user on the browsing mode.
Specifically, in the actual application process, when the browsing mode with the immersive effect is not set, the status bar of the page is located above the title bar and has a large dark color, and when the browsing mode with the immersive effect is set, the color of the status bar corresponding to the page needs to consider the color of the title bar closest to the status bar in the page, so that the status bar and the title bar have the same or close colors, and a two-in-one effect is achieved. Because the status bar and the title bar of the page are both located at the top of the page structure, if the top of the page structure indicates a picture, the background color of the status bar of the page can be set to be transparent, and the text color is set to be dark, if the top of the page structure indicates a solid color, the background color of the status bar of the page can be set to be the same as the solid color, and the text color is set to be a color capable of forming contrast with the solid color, for example, the background color of the status bar is dark, and the text color is set to be light, if the top of the page structure indicates that multiple colors are combined, the background color of the status bar of the page can be set to be the same as the color of the title bar, and can also be set to be transparent, and.
The execution main body of the embodiment can be a configuration device or equipment for the color of characters in a status bar, and the configuration device or equipment can be configured at a client, and a loading request of a page is triggered through the access behavior of a user to the page, so that the server can acquire corresponding page resource data according to a domain name carried by the user to access the page and return the corresponding page resource data to the client, the client renders the page resource data to form a visual image of each module in the page, and the visual image is displayed in the page.
It should be noted that, the page in the embodiment of the present invention is applicable to a native page and an H5 page, and for the native page, after responding to a loading request of the page, a client can directly obtain page resource data from a server, where the page resource data is usually in a list unit form and directly renders a list resource; for the H5 page, after responding to the loading request of the page, the client acquires page resource data, which is an HTML document object, loads the page resource data from top to bottom, and performs parsing and rendering in the process of loading the page resource data.
It is understood that, for a native page, the page resource data is typically obtained from the server based on the network resource, for the H5 page, the page resource data may be obtained from the server based on the network resource, and may also be obtained from a pre-cached resource pool for the server or the server based on the page identifier, and the pre-cached resource pool may continuously collect the page resource data recently or frequently accessed by the user, and the obtaining manner of the page resource data is not limited herein. In general, when a page loading request is triggered, whether a cached resource of the page exists in a pre-cached resource pool is judged based on a corresponding relation between a resource object and a memory resource cache, if not, a server is required to acquire the cached resource based on a network resource, and the acquired page resource is cached in a memory. The resource pool also belongs to an HTML document object, so that the resource pool cannot be infinite, the LRU algorithm can be adopted to cache the resource of the most recently accessed page or the resource data of the most accessed page, whether caching is carried out or not, the caching amount and the caching updating time can be determined through an HTTP protocol, the resource data of the page can be split, and then the split resource data is classified and cached.
102. And analyzing the visual images of the modules in the page to obtain frequency components contained in the visual images of the modules in the page and main colors corresponding to the visual images of the modules in the page.
In the embodiment of the invention, the process of analyzing the visual images of the modules in the page mainly comprises two parts, wherein one part is to perform frequency spectrum analysis on the visual images of the modules in the page so as to obtain frequency components contained in the visual images of the modules in the page; and the other part is to perform color analysis on the visualized images of the modules in the page to acquire the main colors corresponding to the visualized images of the modules in the page.
Specifically, the frequency value of the visual image of each module in the page can be obtained by performing fourier transform on the visual image of each module in the page, and the frequency value of the visual image can represent a gray level change index in the image, namely, a color change degree in the image. For example, a desert with a large area is a region with slow gray level change in an image, and the corresponding frequency value is low, while an edge region with drastic change in surface attribute is a region with drastic gray level change in an image, and the corresponding frequency value is high. The fourier transform can convert the visualized image of each module in the page from a spatial domain to a frequency domain, so as to form a frequency distribution function corresponding to the visualized image of each module in the page, and the frequency components contained in the visualized image of each module in the page can be acquired according to the frequency distribution function.
Specifically, the color information of the whole visual image of each module in the page can be obtained by scanning the pixel values of the visual image of each module in the page, and the color information of the whole visual image can reflect the whole visual color in the image, namely the color abundance degree in the image. For example, the visual images of the modules in the page can give a sense of calmness and tidiness to people by using the color information matched with the blue as the main tone, and the visual images of the modules in the page can give a sense of vitality to people by using the color information matched with the orange as the main tone. The pixel value of the visual image can reflect the color value of each pixel point, and the overall color information of the visual image of each module in the page is obtained by counting the color value distribution condition of the pixel points in the visual image.
103. When a triggering instruction of a target module in the page is detected, configuring the color of characters displayed in the status bar based on the frequency components contained in the visual image of the target module in the page and the main color corresponding to the visual image of the target module.
In the process of browsing a page, a user usually follows with a scrolling operation triggered by the page content to browse more page content, so as to generate an upward sliding of the page content, and the color of the page status bar needs to be configured in combination with the color state of the visual image of the module below the status bar, so that when a triggering instruction of a target module in the page is detected, the color state of the target module in the page can be determined according to a frequency component contained in the visual image of the target module in the page and a main color corresponding to the visual image of the target module, and the triggering instruction can be that the target module in the page slides to the position below the status bar, where the target module in the page can be set to be a preset distance from the position below the status bar, for example, the target module slides to the position 10cm below the status bar, and further configures a character color most suitable for being displayed in the status bar, and the page display effect under different browsing modes is improved.
Compared with the mode of configuring the color of the characters in the status bar by adding a covering layer in the navigation bar in the existing mode, the method for configuring the color of the characters in the status bar provided by the embodiment of the application intercepts the visual images of all modules in the page formed after rendering the page resource data by responding to the loading request of the page, and analyzing the frequency components contained in the visualized images of the modules in the page and the corresponding main colors of the visualized images of the modules in the page, thereby determining the color change condition corresponding to the visual image of each module in the page, when the trigger instruction of the target module in the page is detected, according to the color change condition corresponding to the visual image of each module in the page, the character color displayed in the status bar is automatically adapted, so that the most suitable status bar is displayed, and the user experience of the page browsing mode is improved.
Further, as a refinement and an extension of the specific implementation of the foregoing embodiment, in order to fully describe the specific implementation process of the present embodiment, the present embodiment provides another configuration method for text colors in a status bar, as shown in fig. 2, the method includes:
201. and responding to a loading request of the page, and setting an interception parameter for a section of the page formed after rendering the page resource data.
The method comprises the steps that interception parameters are parameters and return values of methods to be called by an intercepted section, under a common condition, calling of a plurality of methods is involved in the process of rendering page resource data, for example, calling of a rendering component and return values of rendering results are utilized to render each module in a page, and then a visual image of each module of the page is displayed in the page after rendering is finished. The configuration of the status bar in the page needs to be adapted to the color status of each module in the page, so that the rendering result of intercepting the page resource data needs to be analyzed before the rendering result of the page is displayed.
202. And if the triggering instruction of the intercepted section is detected, extracting the visual images of all modules in the page formed after rendering the page resource data according to the parameters and the return values of the calling method required by the intercepted section.
In the embodiment of the present invention, when a client loads a page, an AOP section is made for a rendering result of page resource data formed by each module in the page, the AOP section can pay attention to an interception parameter in an intercepted section, once a behavior in the intercepted page triggers a change of the interception parameter, a trigger instruction of the intercepted section is detected, and a parameter and a return value of a method required by the intercepted section are further used, that is, the interception parameter is used as an entry point to obtain the intercepted page, so that a visual image of each module in the page formed after rendering the page resource data is obtained.
It should be noted that the AOP section can perform section interception on the specified page according to the change of the interception parameter triggered by the behavior in the specified page, and further perform analysis on the specified page, and in the process, only the page is intercepted when the specific behavior occurs on the page, and processing logic is added after the page is intercepted, but the process does not affect the subsequent execution process. After the page interception is performed on the rendering result in the embodiment of the invention, only the processing logic for analyzing the rendering result of the page is added, and the display process of the subsequent rendering result is not influenced.
203. And performing Fourier transform processing on the visual images of the modules in the page to obtain frequency components contained in the visual images of the modules in the page.
It can be understood that if the requirement on the precision is not high, the visualized images of the modules in the page can be subjected to fast fourier transform, frequency components contained in the visualized images of the modules in the page can also be obtained, and the operation speed can be improved.
Specifically, in the process of performing fourier transform processing on the visual image of each module in the page, the visual image of each module in the page can be subjected to fourier transform processing to be a two-dimensional function of the visual image of each module in the page, and the frequency corresponding to each element in the visual image of each module in the page is obtained by calculating the amplitude of each element in the visual image of each module in the page; and acquiring frequency components contained in the visual images of the modules in the page based on the frequency corresponding to the elements in the visual images of the modules in the page.
Because the frequency components contained in the visualized image can reflect the distribution condition of the frequency, specifically, in the process of acquiring the frequency components contained in the visualized image of each module in the page based on the frequency corresponding to the elements in the visualized image of each module in the page, the frequency distribution range corresponding to the elements in the visualized image of each module in the page can be determined based on the frequency distribution range corresponding to the frequency components in the pre-configured frequency component mapping table; and acquiring frequency components contained in the visual images of the modules in the page by counting the frequency distribution range corresponding to the elements in the visual images of the modules in the page.
In the embodiment of the invention, if the frequency components contained in the visual image of the module in the page are mainly high-frequency components, the visual image of the module in the page is colorful and has rich variation; on the contrary, if the frequency component contained in the visualized image of the module in the page is mainly a low-frequency component, it indicates that the color in the visualized image of the module in the page is relatively single and does not change too much.
204. And sampling pixel color values of the visual images of the modules in the page, and extracting the main colors corresponding to the visual images of the modules in the page.
Specifically, a visualized image of each module in a page may be mapped to an image matrix, and pixels in the image matrix are obtained; carrying out periodic sampling on pixels in an image according to a preset sampling interval to obtain pixel sampling points in an image matrix; and extracting the main color corresponding to the visual image of each module in the page by performing visual color simulation on the pixel sampling points in the image matrix.
In the embodiment of the present invention, a rgb value can be obtained for each pixel by sampling the pixel color value of the visualized image of each module in the page, specifically, an image matrix can be formed from the visualized image of each module through the process of performing visual color simulation on the pixel sampling point in the image matrix, the pixel color value in the image matrix is counted, and the dominant color corresponding to the visualized image of each module in the page is extracted, where the dominant color may be an average value of the pixel color value in the counted image matrix, a median value of the pixel color value, or a covariance after the pixel color value is squared, where a statistical manner of the pixel color value is not limited.
It can be understood that, the more the pixel quantity of gathering in the image under the general condition, can reflect the colour of image more, and sampling pixel quantity is too much and need consume a large amount of time, can set up preset sampling interval here according to client equipment's performance, higher to client equipment's performance, can set up sampling interval lower, so that sampling pixel's colour value can more comprehensively cover the colour of image, conversely, lower to client equipment's performance, can set up sampling interval higher, so that sampling pixel's colour value can cover the colour of image from the at utmost.
205. And generating a configuration table suitable for the colors of the characters in the status bar in the page according to the frequency components contained in the visual images of the modules in the page and the main colors corresponding to the visual images of the modules in the page.
In order to enable the status bar to be capable of adapting to the color status of the visualized image of the target module in the page more quickly, the color status of the visualized image of each module in the page can be obtained by analyzing the visualized image of each module in the page in advance according to the frequency components contained in the visualized image of each module in the page and the corresponding main colors of the visualized image of each module in the page, setting the character colors displayed in the adaptation status bar according to the color status of the visualized image of each module in the page, and storing the character colors in the status bar suitable for the page, wherein the configuration table can form a mapping relationship between each module and the character colors in the adaptation status bar, so that when the visualized image of the target module of the page slides to the lower part of the status bar, the character colors in the status bar mapped with the target module can be read according to the color status of the visualized image of the target module, and then the corresponding text color is displayed in the status bar.
For example, the frequency component may be divided into a high-frequency component and a low-frequency component, the main color may be divided into a light color, a dark color, a bright color, and a gray color, the color states of the visualized images of the modules in the page obtained by analyzing the visualized images of the modules in the page in advance include four conditions of a low-light color, a low-dark color, a high-bright color, and a high-gray color, and the character colors displayed in the adaptation state column are set for each color state: the color of the characters in the low-frequency-light color state setting state column is dark, the color of the characters in the low-frequency-dark color state setting state column is light, the color of the characters in the high-frequency-bright color state setting state column is strong dark color/strong light color, and the color of the characters in the high-frequency-slightly gray color state setting state column is theme color/strong dark color.
206. And when a trigger instruction that the target module slides to the lower part of the status bar in the page is detected, reading the character color suitable for being displayed in the status bar from the configuration table based on the frequency component contained in the visual image of the target module in the page and the main color corresponding to the visual image of the target module.
Because the page display includes a plurality of modules, when the modules in the page do not slide below the status bar, the color of the characters displayed in the status bar does not need to be configured, and for the target module sliding below the status bar, the color of the characters displayed in the status bar needs to be configured according to the result of analyzing the visual image of the target module.
It can be understood that, the configuration table may set the character colors suitable for being displayed in the status bar according to the result of analyzing the visualized images of the modules in the page, generate the character colors in the memory, generate the configuration table in the memory for the loading process of each page, and read the character colors suitable for being displayed in the status bar from the configuration table based on the frequency components included in the visualized images of the target modules in the page and the main colors corresponding to the visualized images of the target modules when the target modules slide below the status bar in the page, so as to improve the adaptation speed of the character colors in the status bar.
207. And configuring the text color displayed in the status bar to be suitable for the text color displayed in the status bar.
Further, as a specific implementation of the method in fig. 1 and fig. 2, an embodiment of the present application provides a device for configuring a color of a character in a status bar, as shown in fig. 3, the device includes: an interception unit 31, an analysis unit 32, and a statistic unit 33.
The intercepting unit 31 may be configured to respond to a loading request of a page, and intercept a visual image of each module in the page formed after rendering the page resource data;
the analyzing unit 32 may be configured to obtain frequency components included in the visualized images of the modules in the page and main colors corresponding to the visualized images of the modules in the page by analyzing the visualized images of the modules in the page;
the configuration unit 33 may be configured to configure, when a trigger instruction of a target module in a page is detected, a color of a character displayed in the status bar based on a frequency component included in a visualized image of the target module in the page and a main color corresponding to the visualized image of the target module.
Compared with the mode of configuring the color of the characters in the status bar by adding a covering layer in the navigation bar in the existing mode, the device for configuring the color of the characters in the status bar provided by the embodiment of the invention intercepts the visual images of all modules in the page formed after rendering the page resource data through the loading request of the response type page, and analyzing the frequency components contained in the visualized images of the modules in the page and the corresponding main colors of the visualized images of the modules in the page, thereby determining the color change condition corresponding to the visual image of each module in the page, when the trigger instruction of the target module in the page is detected, according to the color change condition corresponding to the visual image of each module in the page, the character color displayed in the status bar is automatically adapted, so that the most suitable status bar is displayed, and the user experience of the page browsing mode is improved.
In a specific application scenario, as shown in fig. 4, the intercepting unit 31 includes:
the setting module 311 may be configured to set an interception parameter for a section of a page formed after rendering the page resource data, where the interception parameter is a parameter and a return value of a method to be called by the intercepted section;
the extracting module 312 may be configured to, if a trigger instruction of the intercepted cut plane is detected, extract a visual image of each module in the page formed after rendering the page resource data according to the parameter and the return value of the method that is required to be called by the intercepted cut plane.
In a specific application scenario, as shown in fig. 4, the analysis unit 32 includes:
the processing module 321 may be configured to perform fourier transform processing on the visualized image of each module in the page to obtain frequency components included in the visualized image of each module in the page;
the sampling module 322 may be configured to extract a dominant color corresponding to the visual image of each module in the page by sampling a pixel color value of the visual image of each module in the page.
In a specific application scenario, as shown in fig. 4, the processing module 321 includes:
the processing submodule 3211 may be configured to perform fourier transform processing on the visualized image of each module in the page to obtain a two-dimensional function of the visualized image of each module in the page;
the calculating submodule 3212 may be configured to obtain frequencies corresponding to elements in the visual images of the modules in the page by calculating the amplitude of each element in the visual images of the modules in the page;
the obtaining sub-module 3213 may be configured to obtain frequency components included in the visual image of each module in the page based on frequencies corresponding to elements in the visual image of each module in the page.
In a specific application scenario, the obtaining submodule 3213 may be specifically configured to determine, based on a frequency distribution range corresponding to a frequency component in a preconfigured frequency component mapping table, a frequency distribution range corresponding to an element in a visual image of each module in a page;
the obtaining sub-module 3213 may be further configured to obtain frequency components included in the visual image of each module in the page by counting a frequency distribution range corresponding to an element in the visual image of each module in the page.
In a specific application scenario, as shown in fig. 4, the sampling module 322 includes:
the mapping sub-module 3221 may be configured to map the visualized images of the modules in the page into an image matrix, and acquire pixels in the image matrix;
the sampling sub-module 3222 may be configured to perform periodic sampling on pixels in the image according to a preset sampling interval, so as to obtain pixel sampling points in an image matrix;
the extracting sub-module 3223 may be configured to extract a main color corresponding to a visual image of each module in the page by performing visual color simulation on pixel sampling points in the image matrix.
In a specific application scenario, as shown in fig. 4, the apparatus further includes:
the generating unit 34 may be configured to, when the trigger instruction of the target module in the page is detected, generate a configuration table applicable to the color of the character in the status bar in the page according to the frequency component included in the visualized image of each module in the page and the dominant color corresponding to the visualized image of each module in the page before configuring the color of the character displayed in the status bar, where the configuration table records the color of the character applicable to be displayed in the status bar after combining the frequency component included in the visualized image and the dominant color corresponding to the visualized image.
In a specific application scenario, as shown in fig. 4, the configuration unit 33 includes:
the reading module 331 may be configured to read, from the configuration table, a text color suitable for display in the status bar based on a frequency component included in the visualized image of the target module in the page and a main color corresponding to the visualized image of the target module;
a configuration module 332, configured to configure the text color displayed in the status bar to be suitable for the text color displayed in the status bar.
It should be noted that other corresponding descriptions of the functional units related to the configuration device for text colors in the status bar provided in this embodiment may refer to the corresponding descriptions in fig. 1 and fig. 2, and are not repeated herein.
Based on the method shown in fig. 1-2, correspondingly, the present application further provides a storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the method for configuring the color of the text in the status bar shown in fig. 1-2 is implemented.
Based on such understanding, the technical solution of the present application may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (which may be a CD-ROM, a usb disk, a removable hard disk, etc.), and includes several instructions for enabling a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method according to the implementation scenarios of the present application.
Based on the method shown in fig. 1-2 and the virtual device embodiment shown in fig. 3-4, to achieve the above object, an embodiment of the present application further provides a device for configuring a color of a text in a status bar, which may be specifically a computer, a smart phone, a tablet computer, a smart watch, or a network device, where the physical device includes a storage medium and a processor; a storage medium for storing a computer program; and a processor for executing a computer program to implement the above configuration method for the text color in the status bar shown in fig. 1-2.
Optionally, both the two entity devices may further include a user interface, a network interface, a camera, a Radio Frequency (RF) circuit, a sensor, an audio circuit, a WI-FI module, and the like. The user interface may include a Display screen (Display), an input unit such as a keypad (Keyboard), etc., and the optional user interface may also include a USB interface, a card reader interface, etc. The network interface may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface), etc.
Those skilled in the art will appreciate that the physical device structure of the configuration of the text color in the status bar provided by the present embodiment does not constitute a limitation to the physical device, and may include more or less components, or combine some components, or arrange different components.
The storage medium may further include an operating system and a network communication module. The operating system is a program for managing hardware and software resources of the actual device for store search information processing, and supports the operation of the information processing program and other software and/or programs. The network communication module is used for realizing communication among components in the storage medium and communication with other hardware and software in the information processing entity device.
Through the above description of the embodiments, those skilled in the art will clearly understand that the present application can be implemented by software plus a necessary general hardware platform, and can also be implemented by hardware. Through the technical scheme, compared with the existing mode, the method and the device for displaying the text color in the status bar automatically adapt to the text color displayed in the status bar according to the color change condition corresponding to the visual image of each module in the page when the trigger instruction of the target module in the page is detected by determining the color change condition corresponding to the visual image of each module in the page, so that the most suitable status bar is displayed, and the user experience of the page browsing mode is improved
Those skilled in the art will appreciate that the figures are merely schematic representations of one preferred implementation scenario and that the blocks or flow diagrams in the figures are not necessarily required to practice the present application. Those skilled in the art will appreciate that the modules in the devices in the implementation scenario may be distributed in the devices in the implementation scenario according to the description of the implementation scenario, or may be located in one or more devices different from the present implementation scenario with corresponding changes. The modules of the implementation scenario may be combined into one module, or may be further split into a plurality of sub-modules.
The above application serial numbers are for description purposes only and do not represent the superiority or inferiority of the implementation scenarios. The above disclosure is only a few specific implementation scenarios of the present application, but the present application is not limited thereto, and any variations that can be made by those skilled in the art are intended to fall within the scope of the present application.

Claims (10)

1. A method for configuring the color of characters in a status bar is characterized by comprising the following steps:
in response to a loading request of a page, intercepting a visual image of each module in the page formed after rendering page resource data;
analyzing the visual images of the modules in the page to obtain frequency components contained in the visual images of the modules in the page and main colors corresponding to the visual images of the modules in the page;
when a triggering instruction of a target module in the page is detected, configuring the color of characters displayed in the status bar based on the frequency components contained in the visual image of the target module in the page and the main color corresponding to the visual image of the target module.
2. The method according to claim 1, wherein intercepting the visual image of each module in the page formed after rendering the page resource data specifically comprises:
setting interception parameters for a section of a page formed after rendering page resource data, wherein the interception parameters are parameters and return values of methods to be called of the intercepted section;
and if the triggering instruction of the intercepted section is detected, extracting the visual images of all modules in the page formed after rendering the page resource data according to the parameters and the return values of the calling method required by the intercepted section.
3. The method according to claim 1, wherein analyzing the visualized images of the modules in the page to obtain the frequency components included in the visualized images of the modules in the page and the corresponding main colors of the visualized images of the modules in the page specifically includes:
performing Fourier transform processing on the visual images of the modules in the page to obtain frequency components contained in the visual images of the modules in the page;
and sampling pixel color values of the visual images of the modules in the page, and extracting the main colors corresponding to the visual images of the modules in the page.
4. The method according to claim 3, wherein the obtaining of the frequency components included in the visualized image of each module in the page by performing fourier transform processing on the visualized image of each module in the page specifically includes:
performing Fourier transform processing on the visual image of each module in the page to obtain a two-dimensional function of the visual image of each module in the page;
obtaining the frequency corresponding to the element in the visual image of each module in the page by calculating the amplitude of each element in the visual image of each module in the page;
and acquiring frequency components contained in the visual images of the modules in the page based on the frequencies corresponding to the elements in the visual images of the modules in the page.
5. The method according to claim 4, wherein the obtaining of the frequency components included in the visualized image of each module in the page based on the frequencies corresponding to the elements in the visualized image of each module in the page specifically includes:
determining the frequency distribution range corresponding to the elements in the visual image of each module in the page based on the frequency distribution range corresponding to the frequency components in the pre-configured frequency component mapping table;
and acquiring frequency components contained in the visual images of the modules in the page by counting the frequency distribution range corresponding to the elements in the visual images of the modules in the page.
6. The method according to claim 3, wherein the extracting the corresponding dominant color of the visualized image of each module in the page by sampling the pixel color value of the visualized image of each module in the page specifically includes:
mapping the visual images of all modules in the page into an image matrix, and acquiring pixels in the image matrix;
carrying out periodic sampling on pixels in the image according to a preset sampling interval to obtain pixel sampling points in an image matrix;
and extracting the main color corresponding to the visual image of each module in the page by performing visual color simulation on the pixel sampling points in the image matrix.
7. The method according to any one of claims 1 to 6, wherein before configuring the color of the text displayed in the status bar based on the frequency components contained in the visual image of the target module in the page and the corresponding main color of the visual image of the target module when the trigger instruction of the target module in the page is detected, the method further comprises:
and generating a configuration table suitable for the character colors in the status bar in the page according to the frequency components contained in the visual images of the modules in the page and the main colors corresponding to the visual images of the modules in the page, wherein the configuration table records the character colors suitable for being displayed in the status bar after combining the frequency components contained in the visual images and the main colors corresponding to the visual images.
8. An apparatus for configuring color of characters in a status bar, comprising:
the intercepting unit is used for responding to a loading request of the page and intercepting a visual image of each module in the page formed after rendering the page resource data;
the analysis unit is used for analyzing the visual images of the modules in the page to acquire frequency components contained in the visual images of the modules in the page and main colors corresponding to the visual images of the modules in the page;
and the configuration unit is used for configuring the character color displayed in the status bar based on the frequency component contained in the visual image of the target module in the page and the main color corresponding to the visual image of the target module when the trigger instruction of the target module in the page is detected.
9. A storage medium on which a computer program is stored, the program, when executed by a processor, implementing a method of configuring text color in a status bar according to any one of claims 1 to 7.
10. A device for configuring color of characters in a status bar, comprising a storage medium, a processor and a computer program stored on the storage medium and operable on the processor, wherein the processor implements the method for configuring color of characters in a status bar according to any one of claims 1 to 7 when executing the program.
CN202010454094.5A 2020-05-26 2020-05-26 Method, device and equipment for configuring Chinese color in status bar Active CN111722898B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010454094.5A CN111722898B (en) 2020-05-26 2020-05-26 Method, device and equipment for configuring Chinese color in status bar

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010454094.5A CN111722898B (en) 2020-05-26 2020-05-26 Method, device and equipment for configuring Chinese color in status bar

Publications (2)

Publication Number Publication Date
CN111722898A true CN111722898A (en) 2020-09-29
CN111722898B CN111722898B (en) 2023-11-07

Family

ID=72565147

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010454094.5A Active CN111722898B (en) 2020-05-26 2020-05-26 Method, device and equipment for configuring Chinese color in status bar

Country Status (1)

Country Link
CN (1) CN111722898B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113535297A (en) * 2021-06-29 2021-10-22 未鲲(上海)科技服务有限公司 Application program status bar display method, device, equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105786896A (en) * 2014-12-24 2016-07-20 阿里巴巴集团控股有限公司 Color rendering method and device of page sidebar
CN109508222A (en) * 2018-12-21 2019-03-22 北京金山安全软件有限公司 Color configuration method of status bar and related equipment
US20190306477A1 (en) * 2018-03-29 2019-10-03 Konica Minolta Laboratory U.S.A., Inc. Color correction method, system, and computer-readable medium
CN110795659A (en) * 2019-09-25 2020-02-14 口碑(上海)信息技术有限公司 Method and device for generating page background picture
CN111090368A (en) * 2019-12-30 2020-05-01 北京奇艺世纪科技有限公司 Color matching method and device for determining page characters

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105786896A (en) * 2014-12-24 2016-07-20 阿里巴巴集团控股有限公司 Color rendering method and device of page sidebar
US20190306477A1 (en) * 2018-03-29 2019-10-03 Konica Minolta Laboratory U.S.A., Inc. Color correction method, system, and computer-readable medium
CN109508222A (en) * 2018-12-21 2019-03-22 北京金山安全软件有限公司 Color configuration method of status bar and related equipment
CN110795659A (en) * 2019-09-25 2020-02-14 口碑(上海)信息技术有限公司 Method and device for generating page background picture
CN111090368A (en) * 2019-12-30 2020-05-01 北京奇艺世纪科技有限公司 Color matching method and device for determining page characters

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113535297A (en) * 2021-06-29 2021-10-22 未鲲(上海)科技服务有限公司 Application program status bar display method, device, equipment and storage medium
WO2023272856A1 (en) * 2021-06-29 2023-01-05 未鲲(上海)科技服务有限公司 Method for displaying status bar of application program, apparatus, device, and storage medium

Also Published As

Publication number Publication date
CN111722898B (en) 2023-11-07

Similar Documents

Publication Publication Date Title
US20150279058A1 (en) Page Rendering Method and Apparatus
US10388042B2 (en) Efficient display of data points in a user interface
CN109144649A (en) Display methods, device, terminal and the storage medium of icon
AU2017204531B2 (en) Smart and automatic selection of same shaped objects in images
CN102521257B (en) Method and device for providing corresponding on-line picture according to thumbnail
CN111950056B (en) BIM display method and related equipment for building informatization model
US10235712B1 (en) Generating product image maps
EP2874054B1 (en) Application text adjusting method, device, and terminal
CN110149551B (en) Media file playing method and device, storage medium and electronic device
CN110309447B (en) Electronic bookmark generation method, electronic equipment and computer storage medium
CN103744575A (en) Method and equipment for providing input auxiliary areas of input applications
CN110968808A (en) Method and device for realizing webpage theme updating
CN111722898B (en) Method, device and equipment for configuring Chinese color in status bar
CN105095253A (en) Webpage display method and webpage display device
CN104615440A (en) Information processing method and electronic device
Yu et al. Color scheme adaptation to enhance user experience on smartphone displays leveraging ambient light
US9772983B2 (en) Automatic color selection
US10049425B2 (en) Merging filters for a graphic processing unit
US11100112B2 (en) Information processing apparatus, system, method and program for registering and retrieving menu and ingredients
CN113934500A (en) Rendering method, rendering device, storage medium and electronic equipment
CN114363528A (en) Dial generation method and device, terminal device and computer readable storage medium
US11599599B1 (en) Emulating a transparency effect for a display element
CN111405345B (en) Image processing method, image processing device, display device and readable storage medium
CN108984837B (en) Method and system for self-help replacement of floor tile effect on indoor preview picture
AU2022100086A4 (en) Systems and methods for automatically adjusting design element attributes

Legal Events

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