WO2023272856A1 - Method for displaying status bar of application program, apparatus, device, and storage medium - Google Patents

Method for displaying status bar of application program, apparatus, device, and storage medium Download PDF

Info

Publication number
WO2023272856A1
WO2023272856A1 PCT/CN2021/109046 CN2021109046W WO2023272856A1 WO 2023272856 A1 WO2023272856 A1 WO 2023272856A1 CN 2021109046 W CN2021109046 W CN 2021109046W WO 2023272856 A1 WO2023272856 A1 WO 2023272856A1
Authority
WO
WIPO (PCT)
Prior art keywords
color
status bar
target page
image
target
Prior art date
Application number
PCT/CN2021/109046
Other languages
French (fr)
Chinese (zh)
Inventor
徐兵
Original Assignee
未鲲(上海)科技服务有限公司
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 未鲲(上海)科技服务有限公司 filed Critical 未鲲(上海)科技服务有限公司
Publication of WO2023272856A1 publication Critical patent/WO2023272856A1/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces
    • 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/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files
    • G06F9/4451User profiles; Roaming
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M1/00Substation equipment, e.g. for use by subscribers
    • H04M1/72Mobile telephones; Cordless telephones, i.e. devices for establishing wireless links to base stations without route selection
    • H04M1/724User interfaces specially adapted for cordless or mobile telephones
    • H04M1/72403User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality

Definitions

  • the present application relates to the technical field of image extraction, and in particular, the present application relates to a display method, device, device and storage medium of a status bar of an application program.
  • the inventor realized that the color tone of the status bar of the traditional smart phone is relatively single, and the status bar text colors in the status bar are white and black, resulting in poor display effect of the status bar of the application.
  • the color tone of the status bar of the traditional smart phone is relatively single, and the status bar text colors in the status bar are white and black, resulting in poor display effect of the status bar of the application.
  • the main purpose of the present application is to provide a display method, device, device and storage medium of the status bar of the application program, so as to improve the display effect of the status bar of the application program.
  • the present application provides a method for displaying an application status bar, which includes the following steps:
  • the present application also provides a display device for an application status bar, which includes:
  • An intercepting module configured to intercept an image containing the main color of the target page in response to a switching instruction that the application program switches from the current display page to the target page;
  • a determining module configured to determine the text color of the status bar of the target page corresponding to the main color according to the main color of the image
  • a configuration module configured to configure the status bar of the target page according to the text color of the status bar to obtain the target status bar
  • a display module configured to display the target status bar on the target page.
  • the present application also provides a computer device, including a memory and a processor, the memory stores a computer program, and the processor executes a method for displaying an application status bar; wherein, the application status bar
  • the display method includes: responding to the switch instruction of the application program switching from the current display page to the target page, intercepting an image containing the main color of the target page; determining the status bar of the target page corresponding to the main color according to the main color of the image text color; configuring the status bar of the target page according to the text color of the status bar to obtain a target status bar; displaying the target status bar on the target page.
  • the present application also provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, a method for displaying an application status bar is implemented; wherein,
  • the display method of the application program status bar includes: responding to the switching instruction of the application program switching from the current display page to the target page, intercepting an image containing the main color of the target page; determining the corresponding color of the main color according to the main color of the image.
  • the text color of the status bar of the target page configure the status bar of the target page according to the text color of the status bar to obtain the target status bar; display the target status bar in the target page.
  • a method, device, device, and storage medium for displaying an application status bar provided by the present application firstly respond to an application switching instruction from a currently displayed page to a target page, and intercept an image containing the main color of the target page, according to The main color of the image determines the text color of the status bar of the target page corresponding to the main color; then the status bar of the target page is configured according to the text color of the status bar to obtain the target status bar, and the target status bar is displayed on the target page, thereby according to the target page
  • the main color configures the corresponding status bar text color, so that the status bar text color changes with the switching of the main color of the page, so as to improve the display effect of the status bar of the application.
  • FIG. 1 is a schematic flowchart of a method for displaying an application status bar according to an embodiment of the present application
  • FIG. 2 is a schematic structural block diagram of a display device of an application program status bar according to an embodiment of the present application
  • FIG. 3 is a schematic block diagram of a computer device according to an embodiment of the present application.
  • this application proposes a method for displaying the status bar of an application program, which uses a smartphone or a computer device as the execution body to improve the display effect of the status bar of an application program.
  • the application The display method of the program status bar includes the following steps:
  • a switch command is initiated to switch from the current display page to the target page, and the target page is the page displayed next time on the display interface.
  • the smart phone obtains the target page to be switched to, intercepts part or all of the image of the target page from the target page to be switched to, such as intercepting the background area of the target page as an image, and extracts the image in the image.
  • main color tone may be the color with the largest proportion of colors on the target page. For example, when the overall theme color presented on the target page is purple, purple is used as the main color of the target page.
  • the color features of all pixels in the image can be obtained, the number of pixels of each color feature is counted, and the color feature with the largest number of pixels is used as the main color of the target page.
  • the pixel value of the image can reflect the color feature of each pixel, and the overall color of the image in each area of the page can be obtained by counting the distribution of the color features of the pixels in the image.
  • the overall color features of the visualized images in each area of the page can be obtained.
  • the overall color features of the visualized image can reflect the overall visual color in the image, that is, the main color of the image .
  • the pages in this embodiment of the application are applicable to native pages and H5 pages.
  • the page resource data is usually It is in the form of a list unit and directly renders the list resource; for the H5 page, after the smartphone responds to the page loading request, it will obtain the page resource data.
  • the resource data is an HTML document object, and the page resource data is loaded from top to bottom. And perform parsing and rendering during the process of loading page resource data.
  • the text color of the status bar of the target page corresponding to the main color can be determined according to the main color of the image, so as to select the corresponding color of the status bar text of the target page for the main color.
  • the status bar text color is the color of all text displayed in the status bar. Extracting the main color from an image can be used not only for color design, but also for image classification, search, recognition, etc. Identifying the main color of each image is also part of the field of artificial intelligence. The main color of the image can be quickly identified through the image color extraction algorithm Google Palette, color quantization algorithm, and color segmentation method.
  • step S13 after the present embodiment determines the text color of the status bar, configure the status bar of the target page based on the text color of the status bar, such as replacing the original text color of the status bar of the status bar of the target page, so as to obtain the completed configuration Target status bar.
  • this step displays the configured target status bar on the target page, and the status bar text color of the displayed target status bar is similar to the main color of the target page, so that the target status bar is configured according to the main color of the target page
  • the corresponding status bar text color improves the display effect.
  • a method for displaying the status bar of an application program provided by the present application first responds to the switching instruction of the application program from the current display page to the target page, intercepts an image containing the main color of the target page, and determines the main color according to the main color of the image The text color of the status bar of the corresponding target page; then configure the status bar of the target page according to the text color of the status bar to obtain the target status bar, display the target status bar on the target page, and configure the corresponding status bar according to the main color of the target page Text color, so that the text color of the status bar changes with the switching of the main color of the page, so as to improve the display effect of the status bar of the application.
  • step S12 the determining the text color of the status bar of the target page corresponding to the main color according to the main color of the image may specifically include:
  • the image is input into a pre-trained image classification model, and the status bar text color of the target page corresponding to the main tone is output; wherein, the training method of the image classification model includes:
  • the image classification model can be used to assign the corresponding status bar text color according to the main color of the input image, and the trained Core ML models and Xcode projects to build intelligent applications, construct image classification models, and train the constructed image classification models.
  • the number of sample images needs to be greater than the preset number, and the more the number of sample images, the better the training effect of the image classification model.
  • the loss function can include the mean square error loss function and the cross entropy loss function.
  • the mean square error loss function is commonly used in the least squares method. Its idea is to minimize the distance between each training point and the best fitting line (the sum of squares is the smallest) .
  • the cross-entropy loss function describes the distance between two probability distributions, or it can be said that it describes the difficulty of expressing the probability distribution p through the probability distribution q, p represents the correct answer, q represents the predicted value, cross entropy The smaller the loss value calculated by the loss function, the closer the two probability distributions are.
  • the loss value is used to measure the degree of inconsistency between the predicted value f(x) of the image classification model and the real value Y. It is a non-negative real-valued function, usually expressed by L(Y, f(x)), and the loss The smaller the value, the more robust the model.
  • a "model” is the result of applying a machine learning algorithm to a set of training data. It is convenient and quick to use the model to make predictions based on new input data. Core ML models leverage CPU, GPU, and neural network engines while minimizing memory footprint and power consumption to optimize on-device performance. Since the model is strictly on the user's device, it does not require any network connection, which helps to protect the privacy of user data and the responsiveness of the application. After the Core ML model is trained, you can really use this model to make self-service decisions about the status bar of the currently displayed page. You can adjust and optimize the training model according to the actual effect to achieve the best effect.
  • step S12 the determining the text color of the status bar of the target page corresponding to the main color according to the main color of the image may specifically include:
  • a unified default status bar text color can be assigned to the status bar in advance.
  • the default status bar text color can be white or black.
  • the default status can be adjusted based on the color difference Column text color, the default status bar text color after adjusting the color difference is used as the status bar text color of the target page to reduce the difference between the status bar text color and the main color of the target page, further improve the display effect, and enhance the user experience.
  • the color difference is the main color minus the absolute value of the text color of the default status bar.
  • 20 pixels.
  • the principle of complementary colors when determining the text color of the status bar of the target page according to the color difference, can be used to obtain the text color of the status bar of the target page, so that the text color of the status bar of the target page is similar to the main color.
  • the principle of complementary colors means that two colors can be superimposed to obtain white, for example, black and white can be superimposed to obtain white, and red and cyan can be superimposed to obtain white.
  • determining the text color of the status bar of the target page according to the color difference may specifically include:
  • the color difference between the main color and the default status bar text color is within the preset value, that is, to determine whether the main color and the default status bar text color Similarly, when the color difference between the main color and the default status bar text color is greater than the preset value, the default status bar text color cannot be directly adjusted according to the color difference.
  • step S11 the intercepting the image containing the main color of the target page may specifically include:
  • the border area of the status bar can be determined first, and the image area close to the border area of the status bar in the target page is used as an image containing the main color of the target page, such as an image within 5 cm from the lowest point of the border area The area is used as the image to be intercepted, so that the obtained status bar text color is consistent with the image area of the adjacent target page, further improving the display effect of the status bar.
  • step S14 after displaying the target status bar on the target page, it may further include:
  • the background color of the status bar of the target status bar is also adjusted accordingly, so that the user can intuitively see the change of the page display progress, which has an effect on the reading speed.
  • the background color of the page is usually white, and in order to facilitate users to see the icons in the status bar area clearly, the background color of the status bar is usually dark.
  • a gradient can be determined according to the background color of the page and the background color of the status bar Color group, for example, if the background color of the page is white, and the background color of the status bar is black, the color in this gradient color group will gradually change from white to black, for example: white, light gray, dark gray...black.
  • the gradient direction of the gradient color can be the left and right directions, and the order of color change can be darker on the left and lighter on the right, or darker on the right and lighter on the left, so that the background color of the status bar can be determined according to the display content of the target page.
  • the background color of the status bar of the page can be set to transparent, and the text color of the status bar can be set to dark.
  • the top is a solid color
  • the text color of the status bar to a color that can form a contrast with the solid color, for example, the background color of the status bar is dark, and the text color of the status bar is set to light
  • step S143 before performing the gradient display on the target status bar according to the gradient color and the content display progress, it may further include:
  • the background color of the status bar of the target status bar before adjusting the background color of the status bar of the target status bar, it is necessary to judge whether the color difference between the gradient color and the text color of the status bar is within the preset value, and if not, the status bar will not be adjusted temporarily
  • the background color of the status bar should be set to avoid the large difference between the adjusted status bar background color and the status bar text color, which will appear abrupt.
  • an embodiment of the present application also provides a display device for an application status bar, including:
  • An intercepting module 11 configured to intercept an image containing the main color of the target page in response to the switching instruction of the application program switching from the current display page to the target page;
  • Determining module 12 for determining the status bar text color of the target page corresponding to the main color according to the main color of the image
  • the configuration module 13 is configured to configure the status bar of the target page according to the text color of the status bar to obtain the target status bar;
  • a display module 14 configured to display the target status bar on the target page.
  • a switching command is initiated to switch from the current display page to the target page, and the target page is the page displayed next time on the display interface.
  • the smart phone obtains the target page to be switched to, intercepts part or all of the image of the target page from the target page to be switched to, such as intercepting the background area of the target page as an image, and extracts the image in the image.
  • main color tone may be the color with the largest proportion of colors on the target page. For example, when the overall theme color presented on the target page is purple, purple is used as the main color of the target page.
  • the color features of all pixels in the image can be obtained, the number of pixels of each color feature is counted, and the color feature with the largest number of pixels is used as the main color of the target page.
  • the pixel value of the image can reflect the color feature of each pixel, and the overall color of the image in each area of the page can be obtained by counting the distribution of the color features of the pixels in the image.
  • the overall color features of the visualized images in each area of the page can be obtained.
  • the overall color features of the visualized image can reflect the overall visual color in the image, that is, the main color of the image .
  • the pages in this embodiment of the application are applicable to native pages and H5 pages.
  • the page resource data is usually It is in the form of a list unit and directly renders the list resource; for the H5 page, after the smartphone responds to the page loading request, it will obtain the page resource data.
  • the resource data is an HTML document object, and the page resource data is loaded from top to bottom. And perform parsing and rendering during the process of loading page resource data.
  • the text color of the status bar of the target page corresponding to the main color can be determined according to the main color of the image, so as to select the corresponding color of the status bar text of the target page for the main color.
  • the status bar text color is the text displayed in the status bar. Extracting the main color from an image can be used not only for color design, but also for image classification, search, recognition, etc. Identifying the main color of each image is also part of the field of artificial intelligence. The main color of the image can be quickly identified through the image color extraction algorithm Google Palette, color quantization algorithm, and color segmentation method.
  • the status bar of the target page is configured based on the text color of the status bar. For example, the original text color of the status bar of the status bar of the target page is replaced to obtain a configured target status bar.
  • Display the configured target status bar on the target page, and the status bar text color of the displayed target status bar is similar to the main color of the target page, thereby configuring the corresponding status bar text color according to the main color of the target page to improve the display Effect.
  • each component of the device for displaying the application status bar proposed in this application can realize the function of any one of the above methods for displaying the application status bar, and the specific structure will not be repeated here.
  • the embodiment of the present application also provides a computer device, the internal structure of which may be shown in FIG. 3 .
  • the computer device includes a processor, memory, network interface and database connected by a system bus.
  • the processor designed by the computer is used to provide calculation and control capabilities.
  • the memory of the computer device includes a storage medium and an internal memory.
  • the storage medium stores an operating system, computer programs and databases.
  • the memory provides an environment for the operation of the operating system and computer programs in the storage medium.
  • the database of the computer device is used to store data such as images and text in the status bar.
  • the network interface of the computer device is used to communicate with an external terminal via a network connection.
  • the above-mentioned processor executes the above-mentioned method for displaying the status bar of the application program, including:
  • An embodiment of the present application also provides a computer-readable storage medium, the storage medium is a volatile storage medium or a non-volatile storage medium, on which a computer program is stored, and when the computer program is executed by a processor, a The method for displaying the application status bar includes steps:
  • Nonvolatile memory can include read only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory.
  • Volatile memory can include random access memory (RAM) or external cache memory.
  • RAM is available in many forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (SSRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
  • SRAM Static RAM
  • DRAM Dynamic RAM
  • SDRAM Synchronous DRAM
  • SSRSDRAM Double Data Rate SDRAM
  • ESDRAM Enhanced SDRAM
  • SLDRAM Synchronous Link (Synchlink) DRAM
  • SLDRAM Synchronous Link (Synchlink) DRAM
  • Rambus direct RAM
  • DRAM direct memory bus dynamic RAM
  • RDRAM memory bus dynamic RAM
  • a method, device, device, and storage medium for displaying an application status bar provided by the present application firstly respond to an application switching instruction from a currently displayed page to a target page, and intercept an image containing the main color of the target page, according to The main tone of the image determines the status bar text color of the target page corresponding to the main tone; then configure the status bar of the target page according to the status bar text color, obtain the target status bar, and display the target status bar in the target page, thereby Configure the corresponding status bar text color according to the main color of the target page, so that the status bar text color changes with the switching of the main color of the page, so as to improve the display effect of the status bar of the application.

Abstract

A method for displaying a status bar of an application program, an apparatus, a device, and a storage medium, which belong to the technical field of image extraction. The method comprises: in response to a switch instruction for an application program to switch from a current display page to a target page, capturing an image containing the main hue of the target page (S11); determining a status bar text color of the target page corresponding to the main hue according to the main hue of the image (S12); configuring a status bar of the target page according to the status bar text color, and obtaining a target status bar (S13); and displaying the target status bar on the target page (S14). In the method, a corresponding status bar text color is configured according to a main hue of a target page, enabling the status bar text color to change as main hues of pages are switched, so as to improve a status bar display effect of an application program.

Description

应用程序状态栏的显示方法、装置、设备及存储介质Application program status bar display method, device, equipment and storage medium
本申请要求于2021年6月29日提交中国专利局、申请号为202110726607.8,发明名称为“应用程序状态栏的显示方法、装置、设备及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese patent application with the application number 202110726607.8 submitted to the China Patent Office on June 29, 2021, and the title of the invention is "Display method, device, equipment and storage medium of application program status bar", the entire content of which Incorporated in this application by reference.
技术领域technical field
本申请涉及图像提取技术领域,具体而言,本申请涉及一种应用程序状态栏的显示方法、装置、设备及存储介质。The present application relates to the technical field of image extraction, and in particular, the present application relates to a display method, device, device and storage medium of a status bar of an application program.
背景技术Background technique
随着信息技术的发展,基于智能手机操作系统(如iOS系统)的智能手机越来越常见。在操作系统的应用程序页面,最上方会有一个状态栏,用于显示如时间、电量、信号情况、网络情况等状态信息。With the development of information technology, smartphones based on smartphone operating systems (such as iOS systems) are becoming more and more common. On the application page of the operating system, there will be a status bar at the top, which is used to display status information such as time, power, signal status, network status, etc.
但发明人意识到传统的智能手机的状态栏色调比较单一,状态栏中的状态栏文字颜色为白色和黑色两种样式,导致应用程序的状态栏显示效果较差。However, the inventor realized that the color tone of the status bar of the traditional smart phone is relatively single, and the status bar text colors in the status bar are white and black, resulting in poor display effect of the status bar of the application.
技术问题technical problem
传统的智能手机的状态栏色调比较单一,状态栏中的状态栏文字颜色为白色和黑色两种样式,导致应用程序的状态栏显示效果较差。The color tone of the status bar of the traditional smart phone is relatively single, and the status bar text colors in the status bar are white and black, resulting in poor display effect of the status bar of the application.
技术解决方案technical solution
本申请的主要目的为提供一种应用程序状态栏的显示方法、装置、设备及存储介质,以提高应用程序的状态栏显示效果。The main purpose of the present application is to provide a display method, device, device and storage medium of the status bar of the application program, so as to improve the display effect of the status bar of the application program.
第一方面,本申请提供一种应用程序状态栏的显示方法,其包括以下步骤:In a first aspect, the present application provides a method for displaying an application status bar, which includes the following steps:
响应于应用程序从当前显示页面切换至目标页面的切换指令,截取含有目标页面的主色调的图像;Responding to the switching instruction of the application program switching from the current display page to the target page, intercepting an image containing the main color of the target page;
根据所述图像的主色调确定所述主色调对应的目标页面的状态栏文字颜色;Determine the text color of the status bar of the target page corresponding to the main color according to the main color of the image;
根据所述状态栏文字颜色配置所述目标页面的状态栏,得到目标状态栏;Configuring the status bar of the target page according to the text color of the status bar to obtain the target status bar;
将所述目标状态栏在所述目标页面中显示。Displaying the target status bar on the target page.
第二方面,本申请还提供一种应用程序状态栏的显示装置,其包括:In a second aspect, the present application also provides a display device for an application status bar, which includes:
截取模块,用于响应于应用程序从当前显示页面切换至目标页面的切换指令,截取含有目标页面的主色调的图像;An intercepting module, configured to intercept an image containing the main color of the target page in response to a switching instruction that the application program switches from the current display page to the target page;
确定模块,用于根据所述图像的主色调确定所述主色调对应的目标页面的状态栏文字颜色;A determining module, configured to determine the text color of the status bar of the target page corresponding to the main color according to the main color of the image;
配置模块,用于根据所述状态栏文字颜色配置所述目标页面的状态栏,得到目标状态栏;A configuration module, configured to configure the status bar of the target page according to the text color of the status bar to obtain the target status bar;
显示模块,用于将所述目标状态栏在所述目标页面中显示。A display module, configured to display the target status bar on the target page.
第三方面,本申请还提供一种计算机设备,包括存储器和处理器,所述存储器存储有计算机程序,所述处理器执行一种应用程序状态栏的显示方法;其中,所述应用程序状态栏的显示方法包括:响应于应用程序从当前显示页面切换至目标页面的切换指令,截取含有目标页面的主色调的图像;根据所述图像的主色调确定所述主色调对应的目标页面的状态栏文字颜色;根据所述状态栏文字颜色配置所述目标页面的状态栏,得到目标状态栏;将所述目标状态栏在所述目标页面中显示。In a third aspect, the present application also provides a computer device, including a memory and a processor, the memory stores a computer program, and the processor executes a method for displaying an application status bar; wherein, the application status bar The display method includes: responding to the switch instruction of the application program switching from the current display page to the target page, intercepting an image containing the main color of the target page; determining the status bar of the target page corresponding to the main color according to the main color of the image text color; configuring the status bar of the target page according to the text color of the status bar to obtain a target status bar; displaying the target status bar on the target page.
第四方面,本申请还提供一种计算机可读存储介质,所述计算机可读存储介质上存储有计算机程序,该计算机程序被处理器执行时实现一种应用程序状态栏的显示方法;其中,所述应用程序状态栏的显示方法包括:响应于应用程序从当前显示页面切换至目标页面的切换指令,截取含有目标页面的主色调的图像;根据所述图像的主色调确定所述主色调对应的目标页面的状态栏文字颜色;根据所述状态栏文字颜色配置所述目标页面的状态栏,得到目标状态栏;将所述目标状态栏在所述目标页面中显示。In a fourth aspect, the present application also provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, a method for displaying an application status bar is implemented; wherein, The display method of the application program status bar includes: responding to the switching instruction of the application program switching from the current display page to the target page, intercepting an image containing the main color of the target page; determining the corresponding color of the main color according to the main color of the image. The text color of the status bar of the target page; configure the status bar of the target page according to the text color of the status bar to obtain the target status bar; display the target status bar in the target page.
有益效果Beneficial effect
本申请所提供的一种应用程序状态栏的显示方法、装置、设备及存储介质,首先响应于应用程序从当前显示页面切换至目标页面的切换指令,截取含有目标页面的主色调的图像,根据图像的主色调确定主色调对应的目标页面的状态栏文字颜色;然后根据状态栏文字颜色配置目标页面的状态栏,得到目标状态栏,将目标状态栏在目标页面中显示,从而根据目标页面的主色调配置相应的状态栏文字颜色,使状态栏文字颜色随页面主色调的切换而改变,以提高应用程序的状态栏显示效果。A method, device, device, and storage medium for displaying an application status bar provided by the present application firstly respond to an application switching instruction from a currently displayed page to a target page, and intercept an image containing the main color of the target page, according to The main color of the image determines the text color of the status bar of the target page corresponding to the main color; then the status bar of the target page is configured according to the text color of the status bar to obtain the target status bar, and the target status bar is displayed on the target page, thereby according to the target page The main color configures the corresponding status bar text color, so that the status bar text color changes with the switching of the main color of the page, so as to improve the display effect of the status bar of the application.
附图说明Description of drawings
图1为本申请一实施例的应用程序状态栏的显示方法的流程示意图;FIG. 1 is a schematic flowchart of a method for displaying an application status bar according to an embodiment of the present application;
图2为本申请一实施例的应用程序状态栏的显示装置的结构示意框图;FIG. 2 is a schematic structural block diagram of a display device of an application program status bar according to an embodiment of the present application;
图3为本申请一实施例的计算机设备的结构示意框图。FIG. 3 is a schematic block diagram of a computer device according to an embodiment of the present application.
本申请目的的实现、功能特点及优点将结合实施例,参照附图做进一步说明。The realization, functional features and advantages of the present application will be further described in conjunction with the embodiments and with reference to the accompanying drawings.
具体实施方式detailed description
为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。In order to make the purpose, technical solution and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described here are only used to explain the present application, and are not intended to limit the present application.
参考图1,本申请提出一种应用程序状态栏的显示方法,以智能手机或计算机设备为执行主体,用于提高应用程序的状态栏显示效果,参照图1,其中一个实施例中,该应用程序状态栏的显示方法包括如下步骤:Referring to Fig. 1, this application proposes a method for displaying the status bar of an application program, which uses a smartphone or a computer device as the execution body to improve the display effect of the status bar of an application program. Referring to Fig. 1, in one embodiment, the application The display method of the program status bar includes the following steps:
S11、响应于应用程序从当前显示页面切换至目标页面的切换指令,截取含有目标页面的主色调的图像;S11. Responding to the switching instruction of the application program switching from the current display page to the target page, intercepting an image containing the main color of the target page;
S12、根据所述图像的主色调确定所述主色调对应的目标页面的状态栏文字颜色;S12. Determine the text color of the status bar of the target page corresponding to the main color according to the main color of the image;
S13、根据所述状态栏文字颜色配置所述目标页面的状态栏,得到目标状态栏;S13. Configure the status bar of the target page according to the text color of the status bar to obtain the target status bar;
S14、将所述目标状态栏在所述目标页面中显示。S14. Display the target status bar on the target page.
如上述步骤S11所述,当用户在智能手机或计算机设备的显示界面上左右滑动或点击时,发起从当前显示页面切换至目标页面的切换指令,该目标页面为显示界面下一次显示的页面。智能手机响应于所述切换指令,获取待切换至的目标页面,从待切换至的目标页面中截取目标页面部分或全部的图像,如截取目标页面的背景区域作为图像,并提取出图像中的主色调。其中,所述主色调可以是目标页面中颜色占比最大的颜色。例如,当目标页面中整体呈现的主题颜色为紫色时,则将紫色作为目标页面的主色调。As described in the above step S11, when the user slides left or right or clicks on the display interface of the smart phone or computer device, a switch command is initiated to switch from the current display page to the target page, and the target page is the page displayed next time on the display interface. In response to the switching instruction, the smart phone obtains the target page to be switched to, intercepts part or all of the image of the target page from the target page to be switched to, such as intercepting the background area of the target page as an image, and extracts the image in the image. main color tone. Wherein, the main color may be the color with the largest proportion of colors on the target page. For example, when the overall theme color presented on the target page is purple, purple is used as the main color of the target page.
在提取图像中的主色调时,可获取图像中所有像素点的颜色特征,统计每种颜色特征的像素点数量,将像素点数量最多的颜色特征作为目标页面的主色调。其中,这里图像的像素值可以反映每个像素点的颜色特征,通过统计图像中像素点的颜色特征分布情况,获取页面中各个区域的图像整体的颜色。When extracting the main color in the image, the color features of all pixels in the image can be obtained, the number of pixels of each color feature is counted, and the color feature with the largest number of pixels is used as the main color of the target page. Here, the pixel value of the image can reflect the color feature of each pixel, and the overall color of the image in each area of the page can be obtained by counting the distribution of the color features of the pixels in the image.
此外,还可以通过扫描页面中各个区域的可视化图像的像素值,得到页面中各个区域的可视化图像整体的颜色特征,该可视化图像整体的颜色特征能够反映图像中整体视觉颜色,即图像的主色调。In addition, by scanning the pixel values of the visualized images in each area of the page, the overall color features of the visualized images in each area of the page can be obtained. The overall color features of the visualized image can reflect the overall visual color in the image, that is, the main color of the image .
需要说明的是,本申请实施例中页面适用于原生页面、H5页面,对于原生页面,智能手机在响应于页面的加载请求后,能够直接从服务端获取到页面资源数据,该页面资源数据通常为列表单元形式,直接对列表资源进行渲染;对于H5页面,智能手机在响应于页面的加载请求后,会获取页面资源数据,该资源数据为HTML文档对象,由上至下加载页面资源数据,并在加载页面资源数据的过程中进行解析渲染。It should be noted that the pages in this embodiment of the application are applicable to native pages and H5 pages. For native pages, after the smart phone responds to the loading request of the page, it can directly obtain the page resource data from the server. The page resource data is usually It is in the form of a list unit and directly renders the list resource; for the H5 page, after the smartphone responds to the page loading request, it will obtain the page resource data. The resource data is an HTML document object, and the page resource data is loaded from top to bottom. And perform parsing and rendering during the process of loading page resource data.
如上述步骤S12所述,本步骤获取图像后,可根据图像的主色调确定主色调对应的目标页面的状态栏文字颜色,以为所述主色调选取对应的目标页面的状态栏文字颜色。其中,状态栏文字颜色为状态栏中显示的所有文字的颜色。从图像中提取其中的主色调,不仅可以用于色彩设计,也可用于图像分类、搜索、识别等。对每一张图像进行主色调识别也属于人工智能领域中的一部分,可通过图片颜色提取算法Google Palette、颜色量化算法、颜色切分法等快速识别图像的主色调。As described in step S12 above, after the image is acquired in this step, the text color of the status bar of the target page corresponding to the main color can be determined according to the main color of the image, so as to select the corresponding color of the status bar text of the target page for the main color. Wherein, the status bar text color is the color of all text displayed in the status bar. Extracting the main color from an image can be used not only for color design, but also for image classification, search, recognition, etc. Identifying the main color of each image is also part of the field of artificial intelligence. The main color of the image can be quickly identified through the image color extraction algorithm Google Palette, color quantization algorithm, and color segmentation method.
如上述步骤S13所述,本实施例确定状态栏文字颜色后,基于状态栏文字颜色配置目标页面的状态栏,如对目标页面的状态栏的原状态栏文字颜色进行更换,从而得到配置完成的目标状态栏。As described in step S13 above, after the present embodiment determines the text color of the status bar, configure the status bar of the target page based on the text color of the status bar, such as replacing the original text color of the status bar of the status bar of the target page, so as to obtain the completed configuration Target status bar.
如上述步骤S14所述,本步骤将配置完成的目标状态栏在所述目标页面中显示,显示的目标状态栏的状态栏文字颜色与目标页面的主色调相近,从而根据目标页面的主色调配置相应的状态栏文字颜色,提高显示效果。As described in the above-mentioned step S14, this step displays the configured target status bar on the target page, and the status bar text color of the displayed target status bar is similar to the main color of the target page, so that the target status bar is configured according to the main color of the target page The corresponding status bar text color improves the display effect.
本申请所提供的一种应用程序状态栏的显示方法,首先响应于应用程序从当前显示页面切换至目标页面的切换指令,截取含有目标页面的主色调的图像,根据图像的主色调确定主色调对应的目标页面的状态栏文字颜色;然后根据状态栏文字颜色配置目标页面的状态栏,得到目标状态栏,将目标状态栏在目标页面中显示,从而根据目标页面的主色调配置相应的状态栏文字颜色,使状态栏文字颜色随页面主色调的切换而改变,以提高应用程序的状态栏显示效果。A method for displaying the status bar of an application program provided by the present application, first responds to the switching instruction of the application program from the current display page to the target page, intercepts an image containing the main color of the target page, and determines the main color according to the main color of the image The text color of the status bar of the corresponding target page; then configure the status bar of the target page according to the text color of the status bar to obtain the target status bar, display the target status bar on the target page, and configure the corresponding status bar according to the main color of the target page Text color, so that the text color of the status bar changes with the switching of the main color of the page, so as to improve the display effect of the status bar of the application.
在一实施例中,在步骤S12中,所述根据所述图像的主色调确定所述主色调对应的目标页面的状态栏文字颜色,可具体包括:In one embodiment, in step S12, the determining the text color of the status bar of the target page corresponding to the main color according to the main color of the image may specifically include:
将所述图像输入预先训练好的图像分类模型中,输出所述主色调对应的目标页面的状态栏文字颜色;其中,所述图像分类模型的训练方法包括:The image is input into a pre-trained image classification model, and the status bar text color of the target page corresponding to the main tone is output; wherein, the training method of the image classification model includes:
获取已确定主色调的样本图像及每张样本图像对应已标注的标准状态栏文字颜色;Obtain the sample image with the determined main color and the marked standard status bar text color corresponding to each sample image;
将所述样本图像及每张样本图像对应已标注的标准状态栏文字颜色输入图像分类模型中,对所述图像分类模型进行训练;Input the sample image and the marked standard status bar text color into the image classification model corresponding to each sample image, and train the image classification model;
获取所述图像分类模型每次训练后的训练结果,根据训练结果计算所述图像分类模型每次训练后的损失值;Obtain the training result after each training of the image classification model, and calculate the loss value after each training of the image classification model according to the training result;
判断所述损失值是否小于预设损失值;judging whether the loss value is smaller than a preset loss value;
若是,完成所述图像分类模型的训练,得到训练好的所述图像分类模型。If yes, the training of the image classification model is completed to obtain the trained image classification model.
在本实施例中,所述图像分类模型可用于根据输入的图像的主色调分配相应的状态栏文字颜色,可利用训练好的 Core ML 模型和 Xcode 项目打造智能化应用程序,构造图像分类模型,并对构造后的图像分类模型进行训练。具体的,可利用多种主色调的样本图像及每张样本图像对应已标注的标准状态栏文字颜色Create ML模型进行训练,训练出适合的Create ML模型。其中,样本图像的数量需大于预设数量,且样本图像的数量越多,则图像分类模型的训练效果越好。In this embodiment, the image classification model can be used to assign the corresponding status bar text color according to the main color of the input image, and the trained Core ML models and Xcode projects to build intelligent applications, construct image classification models, and train the constructed image classification models. Specifically, you can use sample images of multiple main colors and each sample image corresponds to the marked standard status bar text color Create ML model for training to train a suitable Create ML model. Wherein, the number of sample images needs to be greater than the preset number, and the more the number of sample images, the better the training effect of the image classification model.
在训练过程中,利用预设的损失函数计算所述Create ML模型每次训练后的损失值,并判断所述损失值是否小于预设损失值,若是,则表明Create ML模型训练完成,将训练完成的Create ML模型作为所述图像分类模型。其中,该损失函数可包括均方差损失函数和交叉熵损失函数,均方差损失函数常用在最小二乘法中,它的思想是使得各个训练点到最优拟合线的距离最小(平方和最小)。交叉熵损失函数刻画的是两个概率分布之间的距离,或可以说它刻画的是通过概率分布q来表达概率分布p的困难程度,p代表正确答案,q代表的是预测值,交叉熵损失函数计算得到的损失值越小,两个概率的分布越接近。In the training process, use the preset loss function to calculate the loss value after each training of the Create ML model, and judge whether the loss value is less than the preset loss value, if so, it indicates that the Create ML model training is completed, and the training The completed Create ML model is used as the image classification model. Among them, the loss function can include the mean square error loss function and the cross entropy loss function. The mean square error loss function is commonly used in the least squares method. Its idea is to minimize the distance between each training point and the best fitting line (the sum of squares is the smallest) . The cross-entropy loss function describes the distance between two probability distributions, or it can be said that it describes the difficulty of expressing the probability distribution p through the probability distribution q, p represents the correct answer, q represents the predicted value, cross entropy The smaller the loss value calculated by the loss function, the closer the two probability distributions are.
其中,损失值是用来估量图像分类模型的预测值f(x)与真实值Y的不一致程度,它是一个非负实值函数,通常使用L(Y, f(x))来表示,损失值越小,模型的鲁棒性就越好。 “模型”是对一组训练数据应用机器学习算法而得到的结果,使用模型来基于新的输入数据进行预测,方便快捷。Core ML 模型利用 CPU、GPU和神经网络引擎,同时最大程度地减小内存占用空间和功耗,来优化设备端性能。由于模型严格地在用户设备上,因此无需任何网络连接,这有助于保护用户数据的私密性和应用程序的响应速度。Core ML 模型训练完备后,就可以真正用此模型去自助决策当前显示页面状态栏的,可以根据实际效果调整和优化训练模型,以达到最好的效果。Among them, the loss value is used to measure the degree of inconsistency between the predicted value f(x) of the image classification model and the real value Y. It is a non-negative real-valued function, usually expressed by L(Y, f(x)), and the loss The smaller the value, the more robust the model. A "model" is the result of applying a machine learning algorithm to a set of training data. It is convenient and quick to use the model to make predictions based on new input data. Core ML models leverage CPU, GPU, and neural network engines while minimizing memory footprint and power consumption to optimize on-device performance. Since the model is strictly on the user's device, it does not require any network connection, which helps to protect the privacy of user data and the responsiveness of the application. After the Core ML model is trained, you can really use this model to make self-service decisions about the status bar of the currently displayed page. You can adjust and optimize the training model according to the actual effect to achieve the best effect.
在一实施例中,在步骤S12中,所述根据所述图像的主色调确定所述主色调对应的目标页面的状态栏文字颜色,可具体包括:In one embodiment, in step S12, the determining the text color of the status bar of the target page corresponding to the main color according to the main color of the image may specifically include:
S121、提取所述图像的主色调,并获取所述应用程序的状态栏的默认状态栏文字颜色;S121. Extract the main color of the image, and acquire the default status bar text color of the status bar of the application;
S122、计算所述主色调与所述默认状态栏文字颜色的色差;S122. Calculate the color difference between the main color and the default status bar text color;
S123、根据所述色差确定所述目标页面的状态栏文字颜色。S123. Determine the text color of the status bar of the target page according to the color difference.
在本实施例中,可预先为状态栏分配统一的默认状态栏文字颜色,默认状态栏文字颜色可以是白色或黑色,通过计算主色调与默认状态栏文字颜色的色差,基于该色差调整默认状态栏文字颜色,将调整色差后的默认状态栏文字颜色作为目标页面的状态栏文字颜色,以减少状态栏文字颜色与目标页面的主色调的差异,进一步提高显示效果,提升用户体验。In this embodiment, a unified default status bar text color can be assigned to the status bar in advance. The default status bar text color can be white or black. By calculating the color difference between the main color and the default status bar text color, the default status can be adjusted based on the color difference Column text color, the default status bar text color after adjusting the color difference is used as the status bar text color of the target page to reduce the difference between the status bar text color and the main color of the target page, further improve the display effect, and enhance the user experience.
其中,该色差为主色调减去所述默认状态栏文字颜色的绝对值。该差值表示当前默认状态栏文字颜色的颜色与目标页面的主色调的近似程度。例如,若默认状态栏文字颜色的具体数值为100像素值,主色调的具体数值为120像素值,则差值为120-100=20像素值。若默认状态栏文字颜色的具体数值为100像素值,主色调的具体数值为80像素值,则差值为|80-100|=20 像素值。Wherein, the color difference is the main color minus the absolute value of the text color of the default status bar. The difference indicates how close the current default status bar text color is to the main color of the target page. For example, if the specific value of the text color of the default status bar is 100 pixels, and the specific value of the main color is 120 pixels, then the difference is 120-100=20 pixels. If the specific value of the text color of the default status bar is 100 pixels, and the specific value of the main color is 80 pixels, then the difference is |80-100|=20 pixels.
需要说明的是,本实施例在根据色差确定目标页面的状态栏文字颜色时,可采用互补色原理得到目标页面的状态栏文字颜色,使目标页面的状态栏文字颜色与主色调相近。其中,互补色原理指的是两个颜色叠加后可以得到白色,例如黑色与白色叠加后得到白色,又例如红色与青色叠加后得到白色。It should be noted that, in this embodiment, when determining the text color of the status bar of the target page according to the color difference, the principle of complementary colors can be used to obtain the text color of the status bar of the target page, so that the text color of the status bar of the target page is similar to the main color. Among them, the principle of complementary colors means that two colors can be superimposed to obtain white, for example, black and white can be superimposed to obtain white, and red and cyan can be superimposed to obtain white.
在一实施例中,在步骤S123中,所述根据所述色差确定所述目标页面的状态栏文字颜色,可具体包括:In one embodiment, in step S123, determining the text color of the status bar of the target page according to the color difference may specifically include:
S1231、判断所述主色调与默认状态栏文字颜色的色差是否在预设值内;S1231. Determine whether the color difference between the main color and the default status bar text color is within a preset value;
S1232、若是,将所述默认状态栏文字颜色作为所述目标页面的状态栏文字颜色;S1232. If yes, use the default status bar text color as the status bar text color of the target page;
S1233、否则,从颜色库中选取与所述主色调的色差最小的状态栏文字颜色,得到目标状态栏文字颜色,将所述目标状态栏文字颜色作为所述目标页面的状态栏文字颜色。S1233. Otherwise, select a status bar text color with the smallest color difference from the main color from the color library to obtain a target status bar text color, and use the target status bar text color as the status bar text color of the target page.
在本实施例中,在利用色差确定目标页面的状态栏文字颜色时,可先判断主色调与默认状态栏文字颜色的色差是否在预设值内,即判断主色调与默认状态栏文字颜色是否相近,当主色调与默认状态栏文字颜色的色差大于预设值内时,则无法直接根据色差调整默认状态栏文字颜色,需要从颜色库中获取状态栏文字颜色,计算颜色库中每种状态栏文字颜色与主色调的色差,根据计算结果筛选出与所述主色调的色差最小的状态栏文字颜色,将与所述主色调的色差最小的状态栏文字颜色作为所述目标页面的状态栏文字颜色,以避免状态栏的状态栏文字颜色显得突兀。In this embodiment, when using the color difference to determine the color of the status bar text on the target page, it is first possible to determine whether the color difference between the main color and the default status bar text color is within the preset value, that is, to determine whether the main color and the default status bar text color Similarly, when the color difference between the main color and the default status bar text color is greater than the preset value, the default status bar text color cannot be directly adjusted according to the color difference. It is necessary to obtain the status bar text color from the color library and calculate each status bar in the color library The color difference between the text color and the main color, select the status bar text color with the smallest color difference from the main color according to the calculation results, and use the status bar text color with the smallest color difference from the main color as the status bar text of the target page Color to avoid the status bar text color of the status bar from appearing abrupt.
在一实施例中,在步骤S11中,所述截取含有目标页面的主色调的图像,可具体包括:In one embodiment, in step S11, the intercepting the image containing the main color of the target page may specifically include:
S111、确定所述目标页面的状态栏的边框区域;S111. Determine the frame area of the status bar of the target page;
S112、从所述目标页面中截取距离所述边框区域预设距离内的图像区域,作为含有所述目标页面的主色调的图像。S112. Capture an image area within a preset distance from the frame area from the target page as an image containing the main color of the target page.
本实施例可先确定状态栏的边框区域,将目标页面中靠近所述状态栏的边框区域的图像区域作为含有目标页面的主色调的图像,如将距离边框区域的最低点在5CM内的图像区域作为所需截取的图像,从而使得到的状态栏文字颜色与相邻的目标页面的图像区域,进一步提高状态栏的显示效果。In this embodiment, the border area of the status bar can be determined first, and the image area close to the border area of the status bar in the target page is used as an image containing the main color of the target page, such as an image within 5 cm from the lowest point of the border area The area is used as the image to be intercepted, so that the obtained status bar text color is consistent with the image area of the adjacent target page, further improving the display effect of the status bar.
在一实施例中,在步骤S14中,所述将所述目标状态栏在所述目标页面中显示之后,还可包括:In an embodiment, in step S14, after displaying the target status bar on the target page, it may further include:
S141、获取所述目标状态栏的状态栏背景颜色,并根据所述状态栏背景颜色和所述目标页面的主色调确定渐变颜色组;其中,所述渐变颜色组中包括多个渐变颜色;S141. Obtain the background color of the status bar of the target status bar, and determine a gradient color group according to the background color of the status bar and the main color of the target page; wherein, the gradient color group includes a plurality of gradient colors;
S142、获取所述目标页面的内容显示进度;S142. Obtain the content display progress of the target page;
S143、根据所述渐变颜色及所述内容显示进度对所述目标状态栏进行渐变显示,以对所述状态栏的状态栏背景颜色进行颜色调整。S143. Perform gradient display on the target status bar according to the gradient color and the content display progress, so as to adjust the status bar background color of the status bar.
在本实施例中,随着目标页面的内容显示进度由零变化到一,目标状态栏的状态栏背景颜色也随之调整,可以使用户直观的看到页面显示进度的变化,对阅读速度有整体把握。具体地,页面背景颜色通常为白色,而为了便于用户看清楚状态栏区域的图标,状态栏背景颜色通常为深色,为了使颜色过渡均匀,可以根据页面背景颜色和状态栏背景颜色确定一个渐变颜色组,例如,页面背景颜色为白色,状态栏背景颜色为黑色,该渐变颜色组中的颜色就由白渐变到黑,例如:白色、浅灰色、深灰色…黑色。其中,渐变颜色的渐变方向可以是左右方向,颜色变化的顺序可以为左深右浅,也可以为右深左浅,从而使状态栏背景颜色可根据目标页面的显示内容而定。In this embodiment, as the content display progress of the target page changes from zero to one, the background color of the status bar of the target status bar is also adjusted accordingly, so that the user can intuitively see the change of the page display progress, which has an effect on the reading speed. Overall grasp. Specifically, the background color of the page is usually white, and in order to facilitate users to see the icons in the status bar area clearly, the background color of the status bar is usually dark. In order to make the color transition uniform, a gradient can be determined according to the background color of the page and the background color of the status bar Color group, for example, if the background color of the page is white, and the background color of the status bar is black, the color in this gradient color group will gradually change from white to black, for example: white, light gray, dark gray...black. Wherein, the gradient direction of the gradient color can be the left and right directions, and the order of color change can be darker on the left and lighter on the right, or darker on the right and lighter on the left, so that the background color of the status bar can be determined according to the display content of the target page.
此外,还需进一步计算状态栏文字颜色与状态栏背景颜色的色差,并确保状态栏文字颜色与状态栏背景颜色的色差大于预设值,以使状态栏文字颜色设置为与状态栏背景颜色形成反差的颜色,利于凸显状态栏文字。In addition, it is necessary to further calculate the color difference between the status bar text color and the status bar background color, and ensure that the color difference between the status bar text color and the status bar background color is greater than the preset value, so that the status bar text color is set to form the status bar background color Contrasting colors help to highlight the status bar text.
由于页面的状态栏和标题栏都位于页面结构的顶部,如果页面结构中表明顶部为图片,可以将页面的状态栏背景颜色设置为透明,状态栏文字颜色设置为深色,如果页面结构中表明顶部为纯色,可以将页面的状态栏背景颜色设置为相同的纯色,状态栏文字颜色设置为与纯色能够形成反差的颜色,例如,状态栏的背景颜色为深色,状态栏文字颜色设置为浅色,如果页面结构中表明顶部为多种颜色相结合,可以将页面的状态栏背景颜色设置为与标题栏颜色相同,还可以设置为透明,状态栏文字颜色设置为与状态栏背景颜色形成反差的颜色。Since the status bar and title bar of the page are located at the top of the page structure, if the page structure indicates that the top is a picture, the background color of the status bar of the page can be set to transparent, and the text color of the status bar can be set to dark. The top is a solid color, you can set the background color of the status bar of the page to the same solid color, and the text color of the status bar to a color that can form a contrast with the solid color, for example, the background color of the status bar is dark, and the text color of the status bar is set to light If the page structure indicates that the top is a combination of multiple colors, you can set the background color of the status bar of the page to be the same as the color of the title bar, or set it to be transparent, and set the text color of the status bar to contrast with the background color of the status bar s color.
在一实施例中,在步骤S143中,所述根据所述渐变颜色及所述内容显示进度对所述目标状态栏进行渐变显示之前,还可包括:In an embodiment, in step S143, before performing the gradient display on the target status bar according to the gradient color and the content display progress, it may further include:
计算所述渐变颜色与所述状态栏文字颜色之间的色差;Calculate the color difference between the gradient color and the status bar text color;
判断所述渐变颜色与所述状态栏文字颜色之间的色差是否在预设值内;judging whether the color difference between the gradient color and the text color of the status bar is within a preset value;
若是,执行根据所述渐变颜色及所述内容显示进度对所述目标状态栏进行渐变显示;If so, performing a gradient display on the target status bar according to the gradient color and the content display progress;
否则,不调整所述状态栏的状态栏背景颜色。Otherwise, the status bar background color of the status bar is not adjusted.
在本实施例中,在对目标状态栏的状态栏背景颜色进行颜色调整之前,需要判断渐变颜色与状态栏文字颜色之间的色差是否在预设值内,若否,则暂不调整状态栏的状态栏背景颜色,避免调整后的状态栏背景颜色与状态栏文字颜色差异较大,显得突兀。In this embodiment, before adjusting the background color of the status bar of the target status bar, it is necessary to judge whether the color difference between the gradient color and the text color of the status bar is within the preset value, and if not, the status bar will not be adjusted temporarily The background color of the status bar should be set to avoid the large difference between the adjusted status bar background color and the status bar text color, which will appear abrupt.
参照图2,本申请实施例中还提供一种应用程序状态栏的显示装置,包括:Referring to FIG. 2, an embodiment of the present application also provides a display device for an application status bar, including:
截取模块11,用于响应于应用程序从当前显示页面切换至目标页面的切换指令,截取含有目标页面的主色调的图像;An intercepting module 11, configured to intercept an image containing the main color of the target page in response to the switching instruction of the application program switching from the current display page to the target page;
确定模块12,用于根据所述图像的主色调确定所述主色调对应的目标页面的状态栏文字颜色;Determining module 12, for determining the status bar text color of the target page corresponding to the main color according to the main color of the image;
配置模块13,用于根据所述状态栏文字颜色配置所述目标页面的状态栏,得到目标状态栏;The configuration module 13 is configured to configure the status bar of the target page according to the text color of the status bar to obtain the target status bar;
显示模块14,用于将所述目标状态栏在所述目标页面中显示。A display module 14, configured to display the target status bar on the target page.
当用户在智能手机或计算机设备的显示界面上左右滑动或点击时,发起从当前显示页面切换至目标页面的切换指令,该目标页面为显示界面下一次显示的页面。智能手机响应于所述切换指令,获取待切换至的目标页面,从待切换至的目标页面中截取目标页面部分或全部的图像,如截取目标页面的背景区域作为图像,并提取出图像中的主色调。其中,所述主色调可以是目标页面中颜色占比最大的颜色。例如,当目标页面中整体呈现的主题颜色为紫色时,则将紫色作为目标页面的主色调。When the user slides left or right or clicks on the display interface of the smart phone or the computer device, a switching command is initiated to switch from the current display page to the target page, and the target page is the page displayed next time on the display interface. In response to the switching instruction, the smart phone obtains the target page to be switched to, intercepts part or all of the image of the target page from the target page to be switched to, such as intercepting the background area of the target page as an image, and extracts the image in the image. main color tone. Wherein, the main color may be the color with the largest proportion of colors on the target page. For example, when the overall theme color presented on the target page is purple, purple is used as the main color of the target page.
在提取图像中的主色调时,可获取图像中所有像素点的颜色特征,统计每种颜色特征的像素点数量,将像素点数量最多的颜色特征作为目标页面的主色调。其中,这里图像的像素值可以反映每个像素点的颜色特征,通过统计图像中像素点的颜色特征分布情况,获取页面中各个区域的图像整体的颜色。When extracting the main color in the image, the color features of all pixels in the image can be obtained, the number of pixels of each color feature is counted, and the color feature with the largest number of pixels is used as the main color of the target page. Here, the pixel value of the image can reflect the color feature of each pixel, and the overall color of the image in each area of the page can be obtained by counting the distribution of the color features of the pixels in the image.
此外,还可以通过扫描页面中各个区域的可视化图像的像素值,得到页面中各个区域的可视化图像整体的颜色特征,该可视化图像整体的颜色特征能够反映图像中整体视觉颜色,即图像的主色调。In addition, by scanning the pixel values of the visualized images in each area of the page, the overall color features of the visualized images in each area of the page can be obtained. The overall color features of the visualized image can reflect the overall visual color in the image, that is, the main color of the image .
需要说明的是,本申请实施例中页面适用于原生页面、H5页面,对于原生页面,智能手机在响应于页面的加载请求后,能够直接从服务端获取到页面资源数据,该页面资源数据通常为列表单元形式,直接对列表资源进行渲染;对于H5页面,智能手机在响应于页面的加载请求后,会获取页面资源数据,该资源数据为HTML文档对象,由上至下加载页面资源数据,并在加载页面资源数据的过程中进行解析渲染。It should be noted that the pages in this embodiment of the application are applicable to native pages and H5 pages. For native pages, after the smart phone responds to the loading request of the page, it can directly obtain the page resource data from the server. The page resource data is usually It is in the form of a list unit and directly renders the list resource; for the H5 page, after the smartphone responds to the page loading request, it will obtain the page resource data. The resource data is an HTML document object, and the page resource data is loaded from top to bottom. And perform parsing and rendering during the process of loading page resource data.
在获取图像后,可根据图像的主色调确定主色调对应的目标页面的状态栏文字颜色,以为所述主色调选取对应的目标页面的状态栏文字颜色。其中,状态栏文字颜色为状态栏中显示的文字的。从图像中提取其中的主色调,不仅可以用于色彩设计,也可用于图像分类、搜索、识别等。对每一张图像进行主色调识别也属于人工智能领域中的一部分,可通过图片颜色提取算法Google Palette、颜色量化算法、颜色切分法等快速识别图像的主色调。After the image is acquired, the text color of the status bar of the target page corresponding to the main color can be determined according to the main color of the image, so as to select the corresponding color of the status bar text of the target page for the main color. Wherein, the status bar text color is the text displayed in the status bar. Extracting the main color from an image can be used not only for color design, but also for image classification, search, recognition, etc. Identifying the main color of each image is also part of the field of artificial intelligence. The main color of the image can be quickly identified through the image color extraction algorithm Google Palette, color quantization algorithm, and color segmentation method.
本实施例确定状态栏文字颜色后,基于状态栏文字颜色配置目标页面的状态栏,如对目标页面的状态栏的原状态栏文字颜色进行更换,从而得到配置完成的目标状态栏。In this embodiment, after the text color of the status bar is determined, the status bar of the target page is configured based on the text color of the status bar. For example, the original text color of the status bar of the status bar of the target page is replaced to obtain a configured target status bar.
将配置完成的目标状态栏在所述目标页面中显示,显示的目标状态栏的状态栏文字颜色与目标页面的主色调相近,从而根据目标页面的主色调配置相应的状态栏文字颜色,提高显示效果。Display the configured target status bar on the target page, and the status bar text color of the displayed target status bar is similar to the main color of the target page, thereby configuring the corresponding status bar text color according to the main color of the target page to improve the display Effect.
如上所述,可以理解地,本申请中提出的所述应用程序状态栏的显示装置的各组成部分可以实现如上所述应用程序状态栏的显示方法任一项的功能,具体结构不再赘述。As mentioned above, it can be understood that each component of the device for displaying the application status bar proposed in this application can realize the function of any one of the above methods for displaying the application status bar, and the specific structure will not be repeated here.
参照图3,本申请实施例中还提供一种计算机设备,其内部结构可以如图3所示。该计算机设备包括通过系统总线连接的处理器、存储器、网络接口和数据库。其中,该计算机设计的处理器用于提供计算和控制能力。该计算机设备的存储器包括存储介质、内存储器。该存储介质存储有操作系统、计算机程序和数据库。该内存器为存储介质中的操作系统和计算机程序的运行提供环境。该计算机设备的数据库用于存储图像、状态栏文字等数据。该计算机设备的网络接口用于与外部的终端通过网络连接通信。该计算机程序被处理器执行时以实现一种应用程序状态栏的显示方法。Referring to FIG. 3 , the embodiment of the present application also provides a computer device, the internal structure of which may be shown in FIG. 3 . The computer device includes a processor, memory, network interface and database connected by a system bus. Among them, the processor designed by the computer is used to provide calculation and control capabilities. The memory of the computer device includes a storage medium and an internal memory. The storage medium stores an operating system, computer programs and databases. The memory provides an environment for the operation of the operating system and computer programs in the storage medium. The database of the computer device is used to store data such as images and text in the status bar. The network interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, a method for displaying the status bar of the application program is realized.
上述处理器执行上述的应用程序状态栏的显示方法,包括:The above-mentioned processor executes the above-mentioned method for displaying the status bar of the application program, including:
响应于应用程序从当前显示页面切换至目标页面的切换指令,截取含有目标页面的主色调的图像;Responding to the switching instruction of the application program switching from the current display page to the target page, intercepting an image containing the main color of the target page;
根据所述图像的主色调确定所述主色调对应的目标页面的状态栏文字颜色;根据所述状态栏文字颜色配置所述目标页面的状态栏,得到目标状态栏;Determine the status bar text color of the target page corresponding to the main color according to the main color of the image; configure the status bar of the target page according to the status bar text color to obtain the target status bar;
将所述目标状态栏在所述目标页面中显示。Displaying the target status bar on the target page.
本申请一实施例还提供一种计算机可读存储介质,所述存储介质为易失性存储介质或非易失性存储介质,其上存储有计算机程序,计算机程序被处理器执行时实现一种应用程序状态栏的显示方法,包括步骤:An embodiment of the present application also provides a computer-readable storage medium, the storage medium is a volatile storage medium or a non-volatile storage medium, on which a computer program is stored, and when the computer program is executed by a processor, a The method for displaying the application status bar includes steps:
响应于应用程序从当前显示页面切换至目标页面的切换指令,截取含有目标页面的主色调的图像;Responding to the switching instruction of the application program switching from the current display page to the target page, intercepting an image containing the main color of the target page;
根据所述图像的主色调确定所述主色调对应的目标页面的状态栏文字颜色;根据所述状态栏文字颜色配置所述目标页面的状态栏,得到目标状态栏;Determine the status bar text color of the target page corresponding to the main color according to the main color of the image; configure the status bar of the target page according to the status bar text color to obtain the target status bar;
将所述目标状态栏在所述目标页面中显示。Displaying the target status bar on the target page.
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,所述的计算机程序可存储于一计算机可读取存储介质中,该计算机程序在执行时,可包括如上述各方法的实施例的流程。其中,本申请所提供的和实施例中所使用的对存储器、存储、数据库或其它介质的任何引用,均可包括非易失性和/或易失性存储器。非易失性存储器可以包括只读存储器(ROM)、可编程ROM(PROM)、电可编程ROM(EPROM)、电可擦除可编程ROM(EEPROM)或闪存。易失性存储器可包括随机存取存储器(RAM)或者外部高速缓冲存储器。作为说明而非局限,RAM以多种形式可得,诸如静态RAM(SRAM)、动态RAM(DRAM)、同步DRAM(SDRAM)、双速据率SDRAM(SSRSDRAM)、增强型SDRAM(ESDRAM)、同步链路(Synchlink)DRAM(SLDRAM)、存储器总线(Rambus)直接RAM(RDRAM)、直接存储器总线动态RAM(DRDRAM)、以及存储器总线动态RAM(RDRAM)等。Those of ordinary skill in the art can understand that realizing all or part of the processes in the methods of the above embodiments can be completed by instructing related hardware through a computer program, and the computer program can be stored in a computer-readable storage medium. When the computer program is executed, it may include the processes of the embodiments of the above-mentioned methods. Wherein, any references to memory, storage, database or other media provided in the present application and used in the embodiments may include non-volatile and/or volatile memory. Nonvolatile memory can include read only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (SSRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
综上所述,本申请的最大有益效果在于:In summary, the greatest beneficial effect of the application is:
本申请所提供的一种应用程序状态栏的显示方法、装置、设备及存储介质,首先响应于应用程序从当前显示页面切换至目标页面的切换指令,截取含有目标页面的主色调的图像,根据所述图像的主色调确定所述主色调对应的目标页面的状态栏文字颜色;然后根据状态栏文字颜色配置目标页面的状态栏,得到目标状态栏,将目标状态栏在目标页面中显示,从而根据目标页面的主色调配置相应的状态栏文字颜色,使状态栏文字颜色随页面主色调的切换而改变,以提高应用程序的状态栏显示效果。A method, device, device, and storage medium for displaying an application status bar provided by the present application firstly respond to an application switching instruction from a currently displayed page to a target page, and intercept an image containing the main color of the target page, according to The main tone of the image determines the status bar text color of the target page corresponding to the main tone; then configure the status bar of the target page according to the status bar text color, obtain the target status bar, and display the target status bar in the target page, thereby Configure the corresponding status bar text color according to the main color of the target page, so that the status bar text color changes with the switching of the main color of the page, so as to improve the display effect of the status bar of the application.
需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、装置、物品或者方法不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、装置、物品或者方法所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、装置、物品或者方法中还存在另外的相同要素。It should be noted that, in this document, the term "comprising", "comprising" or any other variation thereof is intended to cover a non-exclusive inclusion such that a process, apparatus, article or method comprising a set of elements includes not only those elements, It also includes other elements not expressly listed, or elements inherent in the process, apparatus, article, or method. Without further limitations, an element defined by the phrase "comprising a ..." does not preclude the presence of additional same elements in the process, apparatus, article or method comprising the element.
以上所述仅为本申请的优选实施例,并非因此限制本申请的专利范围,凡是利用本申请说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本申请的专利保护范围内。The above are only preferred embodiments of the application, and are not intended to limit the patent scope of the application. Any equivalent structure or equivalent process conversion made by using the specification and drawings of the application, or directly or indirectly used in other related All technical fields are equally included in the patent protection scope of the present application.

Claims (20)

  1. 一种应用程序状态栏的显示方法,其中,包括以下步骤:A method for displaying an application status bar, comprising the following steps:
    响应于应用程序从当前显示页面切换至目标页面的切换指令,截取含有目标页面的主色调的图像;Responding to the switching instruction of the application program switching from the current display page to the target page, intercepting an image containing the main color of the target page;
    根据所述图像的主色调确定所述主色调对应的目标页面的状态栏文字颜色;Determine the text color of the status bar of the target page corresponding to the main color according to the main color of the image;
    根据所述状态栏文字颜色配置所述目标页面的状态栏,得到目标状态栏;Configuring the status bar of the target page according to the text color of the status bar to obtain the target status bar;
    将所述目标状态栏在所述目标页面中显示。Displaying the target status bar on the target page.
  2. 根据权利要求1所述的方法,其中,所述根据所述图像的主色调确定所述主色调对应的目标页面的状态栏文字颜色,包括:The method according to claim 1, wherein said determining the status bar text color of the target page corresponding to the main color according to the main color of the image comprises:
    将所述图像输入预先训练好的图像分类模型中,输出所述主色调对应的目标页面的状态栏文字颜色;其中,所述图像分类模型的训练方法包括:The image is input into a pre-trained image classification model, and the status bar text color of the target page corresponding to the main tone is output; wherein, the training method of the image classification model includes:
    获取已确定主色调的样本图像及每张样本图像对应已标注的标准状态栏文字颜色;Obtain the sample image with the determined main color and the marked standard status bar text color corresponding to each sample image;
    将所述样本图像及每张样本图像对应已标注的标准状态栏文字颜色输入图像分类模型中,对所述图像分类模型进行训练;Input the sample image and the marked standard status bar text color into the image classification model corresponding to each sample image, and train the image classification model;
    获取所述图像分类模型每次训练后的训练结果,根据训练结果计算所述图像分类模型每次训练后的损失值;Obtain the training result after each training of the image classification model, and calculate the loss value after each training of the image classification model according to the training result;
    判断所述损失值是否小于预设损失值;judging whether the loss value is smaller than a preset loss value;
    若是,完成所述图像分类模型的训练,得到训练好的所述图像分类模型。If yes, the training of the image classification model is completed to obtain the trained image classification model.
  3. 根据权利要求1所述的方法,其中,所述根据所述图像的主色调确定所述主色调对应的目标页面的状态栏文字颜色,包括:The method according to claim 1, wherein said determining the status bar text color of the target page corresponding to the main color according to the main color of the image comprises:
    提取所述图像的主色调,并获取所述应用程序的状态栏的默认状态栏文字颜色;extracting the main color of the image, and obtaining the default status bar text color of the status bar of the application;
    计算所述主色调与所述默认状态栏文字颜色的色差;Calculate the color difference between the main color and the default status bar text color;
    根据所述色差确定所述目标页面的状态栏文字颜色。Determine the text color of the status bar of the target page according to the color difference.
  4. 根据权利要求3所述的方法,其中,所述根据所述色差确定所述目标页面的状态栏文字颜色,包括:The method according to claim 3, wherein said determining the status bar text color of the target page according to the color difference comprises:
    判断所述主色调与默认状态栏文字颜色的色差是否在预设值内;Judging whether the color difference between the main color and the default status bar text color is within a preset value;
    若是,将所述默认状态栏文字颜色作为所述目标页面的状态栏文字颜色;If so, use the default status bar text color as the status bar text color of the target page;
    否则,从颜色库中选取与所述主色调的色差最小的状态栏文字颜色,得到目标状态栏文字颜色,将所述目标状态栏文字颜色作为所述目标页面的状态栏文字颜色。Otherwise, select the status bar text color with the smallest color difference from the main color from the color library to obtain the target status bar text color, and use the target status bar text color as the status bar text color of the target page.
  5. 根据权利要求1所述的方法,其中,所述截取含有目标页面的主色调的图像,包括:The method according to claim 1, wherein said intercepting an image containing the main color of the target page comprises:
    确定所述目标页面的状态栏的边框区域;Determine the frame area of the status bar of the target page;
    从所述目标页面中截取距离所述边框区域预设距离内的图像区域,作为含有所述目标页面的主色调的图像。An image area within a preset distance from the frame area is intercepted from the target page as an image containing the main color of the target page.
  6. 根据权利要求1所述的方法,其中,所述将所述目标状态栏在所述目标页面中显示之后,还包括:The method according to claim 1, wherein, after displaying the target status bar on the target page, further comprising:
    获取所述目标状态栏的状态栏背景颜色,并根据所述状态栏背景颜色和所述目标页面的主色调确定渐变颜色组;其中,所述渐变颜色组中包括多个渐变颜色;Obtain the background color of the status bar of the target status bar, and determine a gradient color group according to the background color of the status bar and the main color of the target page; wherein, the gradient color group includes a plurality of gradient colors;
    获取所述目标页面的内容显示进度;Obtaining the content of the target page to display the progress;
    根据所述渐变颜色及所述内容显示进度对所述目标状态栏进行渐变显示,以对所述状态栏的状态栏背景颜色进行颜色调整。Perform gradient display on the target status bar according to the gradient color and the content display progress, so as to adjust the status bar background color of the status bar.
  7. 根据权利要求6所述的方法,其中,所述根据所述渐变颜色及所述内容显示进度对所述目标状态栏进行渐变显示之前,还包括:The method according to claim 6, wherein, before performing a gradient display on the target status bar according to the gradient color and the content display progress, further comprising:
    计算所述渐变颜色与所述状态栏文字颜色之间的色差;Calculate the color difference between the gradient color and the status bar text color;
    判断所述渐变颜色与所述状态栏文字颜色之间的色差是否在预设值内;judging whether the color difference between the gradient color and the text color of the status bar is within a preset value;
    若是,执行根据所述渐变颜色及所述内容显示进度对所述目标状态栏进行渐变显示;If so, performing a gradient display on the target status bar according to the gradient color and the content display progress;
    否则,不调整所述状态栏的状态栏背景颜色。Otherwise, the status bar background color of the status bar is not adjusted.
  8. 一种应用程序状态栏的显示装置,其中,包括:A display device for an application status bar, including:
    截取模块,用于响应于应用程序从当前显示页面切换至目标页面的切换指令,截取含有目标页面的主色调的图像;An intercepting module, configured to intercept an image containing the main color of the target page in response to a switching instruction that the application program switches from the current display page to the target page;
    确定模块,用于根据所述图像的主色调确定所述主色调对应的目标页面的状态栏文字颜色;A determining module, configured to determine the text color of the status bar of the target page corresponding to the main color according to the main color of the image;
    配置模块,用于根据所述状态栏文字颜色配置所述目标页面的状态栏,得到目标状态栏;A configuration module, configured to configure the status bar of the target page according to the text color of the status bar to obtain the target status bar;
    显示模块,用于将所述目标状态栏在所述目标页面中显示。A display module, configured to display the target status bar on the target page.
  9. 一种计算机设备,其中,包括:A computer device, comprising:
    处理器;processor;
    存储器;memory;
    计算机程序,其中所述计算机程序被存储在所述存储器中并被配置为由所述处理器执行,所述计算机程序配置用于执行一种应用程序状态栏的显示方法;A computer program, wherein the computer program is stored in the memory and configured to be executed by the processor, the computer program is configured to perform a display method of an application status bar;
    其中,所述应用程序状态栏的显示方法包括:Wherein, the display method of the application status bar includes:
    响应于应用程序从当前显示页面切换至目标页面的切换指令,截取含有目标页面的主色调的图像;Responding to the switching instruction of the application program switching from the current display page to the target page, intercepting an image containing the main color of the target page;
    根据所述图像的主色调确定所述主色调对应的目标页面的状态栏文字颜色;Determine the text color of the status bar of the target page corresponding to the main color according to the main color of the image;
    根据所述状态栏文字颜色配置所述目标页面的状态栏,得到目标状态栏;Configuring the status bar of the target page according to the text color of the status bar to obtain the target status bar;
    将所述目标状态栏在所述目标页面中显示。Displaying the target status bar on the target page.
  10. 根据权利要求9所述的计算机设备,其中,所述根据所述图像的主色调确定所述主色调对应的目标页面的状态栏文字颜色,包括:The computer device according to claim 9, wherein said determining the status bar text color of the target page corresponding to the main color according to the main color of the image comprises:
    将所述图像输入预先训练好的图像分类模型中,输出所述主色调对应的目标页面的状态栏文字颜色;其中,所述图像分类模型的训练方法包括:The image is input into a pre-trained image classification model, and the status bar text color of the target page corresponding to the main tone is output; wherein, the training method of the image classification model includes:
    获取已确定主色调的样本图像及每张样本图像对应已标注的标准状态栏文字颜色;Obtain the sample image with the determined main color and the marked standard status bar text color corresponding to each sample image;
    将所述样本图像及每张样本图像对应已标注的标准状态栏文字颜色输入图像分类模型中,对所述图像分类模型进行训练;Input the sample image and the marked standard status bar text color into the image classification model corresponding to each sample image, and train the image classification model;
    获取所述图像分类模型每次训练后的训练结果,根据训练结果计算所述图像分类模型每次训练后的损失值;Obtain the training result after each training of the image classification model, and calculate the loss value after each training of the image classification model according to the training result;
    判断所述损失值是否小于预设损失值;judging whether the loss value is smaller than a preset loss value;
    若是,完成所述图像分类模型的训练,得到训练好的所述图像分类模型。If yes, the training of the image classification model is completed to obtain the trained image classification model.
  11. 根据权利要求9所述的计算机设备,其中,所述根据所述图像的主色调确定所述主色调对应的目标页面的状态栏文字颜色,包括:The computer device according to claim 9, wherein said determining the status bar text color of the target page corresponding to the main color according to the main color of the image comprises:
    提取所述图像的主色调,并获取所述应用程序的状态栏的默认状态栏文字颜色;extracting the main color of the image, and obtaining the default status bar text color of the status bar of the application;
    计算所述主色调与所述默认状态栏文字颜色的色差;Calculate the color difference between the main color and the default status bar text color;
    根据所述色差确定所述目标页面的状态栏文字颜色。Determine the text color of the status bar of the target page according to the color difference.
  12. 根据权利要求11所述的计算机设备,其中,所述根据所述色差确定所述目标页面的状态栏文字颜色,包括:The computer device according to claim 11, wherein said determining the status bar text color of the target page according to the color difference comprises:
    判断所述主色调与默认状态栏文字颜色的色差是否在预设值内;Judging whether the color difference between the main color and the default status bar text color is within a preset value;
    若是,将所述默认状态栏文字颜色作为所述目标页面的状态栏文字颜色;If so, use the default status bar text color as the status bar text color of the target page;
    否则,从颜色库中选取与所述主色调的色差最小的状态栏文字颜色,得到目标状态栏文字颜色,将所述目标状态栏文字颜色作为所述目标页面的状态栏文字颜色。Otherwise, select the status bar text color with the smallest color difference from the main color from the color library to obtain the target status bar text color, and use the target status bar text color as the status bar text color of the target page.
  13. 根据权利要求9所述的计算机设备,其中,所述截取含有目标页面的主色调的图像,包括:The computer device according to claim 9, wherein said intercepting the image containing the main color of the target page comprises:
    确定所述目标页面的状态栏的边框区域;Determine the frame area of the status bar of the target page;
    从所述目标页面中截取距离所述边框区域预设距离内的图像区域,作为含有所述目标页面的主色调的图像。An image area within a preset distance from the frame area is intercepted from the target page as an image containing the main color of the target page.
  14. 根据权利要求9所述的计算机设备,其中,所述将所述目标状态栏在所述目标页面中显示之后,还包括:The computer device according to claim 9, wherein, after displaying the target status bar on the target page, further comprising:
    获取所述目标状态栏的状态栏背景颜色,并根据所述状态栏背景颜色和所述目标页面的主色调确定渐变颜色组;其中,所述渐变颜色组中包括多个渐变颜色;Obtain the background color of the status bar of the target status bar, and determine a gradient color group according to the background color of the status bar and the main color of the target page; wherein, the gradient color group includes a plurality of gradient colors;
    获取所述目标页面的内容显示进度;Obtaining the content of the target page to display the progress;
    根据所述渐变颜色及所述内容显示进度对所述目标状态栏进行渐变显示,以对所述状态栏的状态栏背景颜色进行颜色调整。Perform gradient display on the target status bar according to the gradient color and the content display progress, so as to adjust the status bar background color of the status bar.
  15. 一种计算机可读存储介质,其中,所述计算机可读存储介质上存储有计算机程序,该计算机程序被处理器执行时实现一种应用程序状态栏的显示方法;A computer-readable storage medium, wherein a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, a method for displaying an application status bar is implemented;
    其中,所述应用程序状态栏的显示方法包括:Wherein, the display method of the application status bar includes:
    响应于应用程序从当前显示页面切换至目标页面的切换指令,截取含有目标页面的主色调的图像;Responding to the switching instruction of the application program switching from the current display page to the target page, intercepting an image containing the main color of the target page;
    根据所述图像的主色调确定所述主色调对应的目标页面的状态栏文字颜色;Determine the text color of the status bar of the target page corresponding to the main color according to the main color of the image;
    根据所述状态栏文字颜色配置所述目标页面的状态栏,得到目标状态栏;Configuring the status bar of the target page according to the text color of the status bar to obtain the target status bar;
    将所述目标状态栏在所述目标页面中显示。Displaying the target status bar on the target page.
  16. 根据权利要求15所述的计算机可读存储介质,其中,所述根据所述图像的主色调确定所述主色调对应的目标页面的状态栏文字颜色,包括:The computer-readable storage medium according to claim 15, wherein said determining the text color of the status bar of the target page corresponding to the main color according to the main color of the image comprises:
    将所述图像输入预先训练好的图像分类模型中,输出所述主色调对应的目标页面的状态栏文字颜色;其中,所述图像分类模型的训练方法包括:The image is input into a pre-trained image classification model, and the status bar text color of the target page corresponding to the main tone is output; wherein, the training method of the image classification model includes:
    获取已确定主色调的样本图像及每张样本图像对应已标注的标准状态栏文字颜色;Obtain the sample image with the determined main color and the marked standard status bar text color corresponding to each sample image;
    将所述样本图像及每张样本图像对应已标注的标准状态栏文字颜色输入图像分类模型中,对所述图像分类模型进行训练;Input the sample image and the marked standard status bar text color into the image classification model corresponding to each sample image, and train the image classification model;
    获取所述图像分类模型每次训练后的训练结果,根据训练结果计算所述图像分类模型每次训练后的损失值;Obtain the training result after each training of the image classification model, and calculate the loss value after each training of the image classification model according to the training result;
    判断所述损失值是否小于预设损失值;judging whether the loss value is smaller than a preset loss value;
    若是,完成所述图像分类模型的训练,得到训练好的所述图像分类模型。If yes, the training of the image classification model is completed to obtain the trained image classification model.
  17. 根据权利要求15所述的计算机可读存储介质,其中,所述根据所述图像的主色调确定所述主色调对应的目标页面的状态栏文字颜色,包括:The computer-readable storage medium according to claim 15, wherein said determining the text color of the status bar of the target page corresponding to the main color according to the main color of the image comprises:
    提取所述图像的主色调,并获取所述应用程序的状态栏的默认状态栏文字颜色;extracting the main color of the image, and obtaining the default status bar text color of the status bar of the application;
    计算所述主色调与所述默认状态栏文字颜色的色差;Calculate the color difference between the main color and the default status bar text color;
    根据所述色差确定所述目标页面的状态栏文字颜色。Determine the text color of the status bar of the target page according to the color difference.
  18. 根据权利要求17所述的计算机可读存储介质,其中,所述根据所述色差确定所述目标页面的状态栏文字颜色,包括:The computer-readable storage medium according to claim 17, wherein said determining the text color of the status bar of the target page according to the color difference comprises:
    判断所述主色调与默认状态栏文字颜色的色差是否在预设值内;Judging whether the color difference between the main color and the default status bar text color is within a preset value;
    若是,将所述默认状态栏文字颜色作为所述目标页面的状态栏文字颜色;If so, use the default status bar text color as the status bar text color of the target page;
    否则,从颜色库中选取与所述主色调的色差最小的状态栏文字颜色,得到目标状态栏文字颜色,将所述目标状态栏文字颜色作为所述目标页面的状态栏文字颜色。Otherwise, select the status bar text color with the smallest color difference from the main color from the color library to obtain the target status bar text color, and use the target status bar text color as the status bar text color of the target page.
  19. 根据权利要求15所述的计算机可读存储介质,其中,所述截取含有目标页面的主色调的图像,包括:The computer-readable storage medium according to claim 15, wherein said intercepting the image containing the main color of the target page comprises:
    确定所述目标页面的状态栏的边框区域;Determine the frame area of the status bar of the target page;
    从所述目标页面中截取距离所述边框区域预设距离内的图像区域,作为含有所述目标页面的主色调的图像。An image area within a preset distance from the frame area is intercepted from the target page as an image containing the main color of the target page.
  20. 根据权利要求15所述的计算机可读存储介质,其中,所述将所述目标状态栏在所述目标页面中显示之后,还包括:The computer-readable storage medium according to claim 15, wherein, after displaying the target status bar on the target page, further comprising:
    获取所述目标状态栏的状态栏背景颜色,并根据所述状态栏背景颜色和所述目标页面的主色调确定渐变颜色组;其中,所述渐变颜色组中包括多个渐变颜色;Obtain the background color of the status bar of the target status bar, and determine a gradient color group according to the background color of the status bar and the main color of the target page; wherein, the gradient color group includes a plurality of gradient colors;
    获取所述目标页面的内容显示进度;Obtaining the content of the target page to display the progress;
    根据所述渐变颜色及所述内容显示进度对所述目标状态栏进行渐变显示,以对所述状态栏的状态栏背景颜色进行颜色调整。Perform gradient display on the target status bar according to the gradient color and the content display progress, so as to adjust the status bar background color of the status bar.
PCT/CN2021/109046 2021-06-29 2021-07-28 Method for displaying status bar of application program, apparatus, device, and storage medium WO2023272856A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110726607.8A CN113535297B (en) 2021-06-29 2021-06-29 Application program status bar display method, device, equipment and storage medium
CN202110726607.8 2021-06-29

Publications (1)

Publication Number Publication Date
WO2023272856A1 true WO2023272856A1 (en) 2023-01-05

Family

ID=78097080

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/109046 WO2023272856A1 (en) 2021-06-29 2021-07-28 Method for displaying status bar of application program, apparatus, device, and storage medium

Country Status (2)

Country Link
CN (1) CN113535297B (en)
WO (1) WO2023272856A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114968466A (en) * 2022-07-14 2022-08-30 深圳市明源云空间电子商务有限公司 Page color matching adjustment method and device, electronic equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103440326A (en) * 2013-09-02 2013-12-11 百度在线网络技术(北京)有限公司 Method and apparatus for providing representation information
CN105867730A (en) * 2016-03-24 2016-08-17 广东欧珀移动通信有限公司 Display method and device for status bar
CN111368238A (en) * 2020-03-19 2020-07-03 Tcl移动通信科技(宁波)有限公司 Status bar adjusting method and device, mobile terminal and storage medium
CN111722898A (en) * 2020-05-26 2020-09-29 口碑(上海)信息技术有限公司 Configuration method, device and equipment for character color in status bar

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106502689A (en) * 2016-11-02 2017-03-15 珠海市魅族科技有限公司 A kind of display methods of status bar and device
CN107193434A (en) * 2017-04-11 2017-09-22 深圳市金立通信设备有限公司 Status bar display method and terminal
CN110471737B (en) * 2019-08-21 2022-08-16 深圳市网心科技有限公司 Immersive status bar setting method and related device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103440326A (en) * 2013-09-02 2013-12-11 百度在线网络技术(北京)有限公司 Method and apparatus for providing representation information
CN105867730A (en) * 2016-03-24 2016-08-17 广东欧珀移动通信有限公司 Display method and device for status bar
CN111368238A (en) * 2020-03-19 2020-07-03 Tcl移动通信科技(宁波)有限公司 Status bar adjusting method and device, mobile terminal and storage medium
CN111722898A (en) * 2020-05-26 2020-09-29 口碑(上海)信息技术有限公司 Configuration method, device and equipment for character color in status bar

Also Published As

Publication number Publication date
CN113535297A (en) 2021-10-22
CN113535297B (en) 2023-02-03

Similar Documents

Publication Publication Date Title
CN108288075B (en) A kind of lightweight small target detecting method improving SSD
TWI773189B (en) Method of detecting object based on artificial intelligence, device, equipment and computer-readable storage medium
CN112200062B (en) Target detection method and device based on neural network, machine readable medium and equipment
WO2021129181A1 (en) Portrait segmentation method, model training method and electronic device
CN112819686B (en) Image style processing method and device based on artificial intelligence and electronic equipment
CN111738231A (en) Target object detection method and device, computer equipment and storage medium
US20220138912A1 (en) Image dehazing method, apparatus, and device, and computer storage medium
US11961203B2 (en) Image processing device and operation method therefor
US20230040256A1 (en) Image coloring method and apparatus based on artificial intelligence, electronic device, and computer readable storage medium
US11068736B2 (en) Method and apparatus for detecting target objects in images
KR20190040755A (en) Method for detecting malware using file image and apparatus using the same
WO2023272856A1 (en) Method for displaying status bar of application program, apparatus, device, and storage medium
CN111582155B (en) Living body detection method, living body detection device, computer equipment and storage medium
CN113515246A (en) Electronic ink screen display control method, device, equipment and storage medium
CN110390254A (en) Character analysis method, apparatus, computer equipment and storage medium based on face
CN114724145A (en) Character image recognition method, device, equipment and medium
CN111898544B (en) Text image matching method, device and equipment and computer storage medium
US11495049B2 (en) Biometric feature reconstruction method, storage medium and neural network
Zhang et al. Foggy images classification based on features extraction and SVM
CN111783062B (en) Verification code identification method, device, computer equipment and storage medium
WO2023173546A1 (en) Method and apparatus for training text recognition model, and computer device and storage medium
Tomei et al. Image-to-image translation to unfold the reality of artworks: an empirical analysis
CN111651626B (en) Image classification method, device and readable storage medium
CN110955369B (en) Focus judgment method, device and equipment based on click position and storage medium
CN114331932A (en) Target image generation method and device, computing equipment and computer storage medium

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21947798

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE