Interface element display method and apparatus, electronic device, and readable storage medium
By acquiring and processing the inverse color values of target interface elements, the problem of poor display effect of interface elements in dark mode is solved, reducing the workload of development and achieving ideal display.
Patent Information
- Application Number
- CN202310236643.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-13
- Publication Date
- 2026-02-27
- Estimated Expiration
- 2043-03-13
AI Technical Summary
In dark mode, the display of interface elements is poor, which requires developers to configure resources for each child view, increasing the development workload.
Obtain the target color value of the target interface element in the target display mode, determine the inverse color value based on the target color value, and perform inverse color processing on the target interface element when entering the target display mode so as to display the target interface element according to the target color value.
It reduces the workload of developers in configuring resources for interface elements, achieves ideal display effects in dark mode, and does not affect the child view area.
Smart Images

Figure CN116343636B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application belongs to the technical field of electronic devices, and particularly relates to an interface element display method and device, an electronic device, and a readable storage medium. BACKGROUND
[0002] In order to improve the eye comfort of a user in different light environments, some display modes are provided in an electronic device, such as a dark mode suitable for use in a dim environment.
[0003] In the related art, during the application development stage, a developer can set a forced reverse color mechanism in an application theme to be in an open state, so as to realize the adaptive display of an application interface in a dark mode. If the display effect of a certain interface element of the application interface in the dark mode is poor, the developer can set the forced reverse color mechanism of the interface element to be in a closed state, and specially configure resources for the interface element, so as to improve the display effect of the interface element in the dark mode.
[0004] However, if the interface element is prohibited from forced reverse color, the child view areas of the interface element cannot also be subjected to forced reverse color. Thus, the developer needs to additionally configure resources for each child view area, which greatly increases the adaptation workload of the developer. SUMMARY
[0005] The embodiments of the present application aim to provide an interface element display method and device, an electronic device, and a readable storage medium, which can solve the problem of a large workload of a developer in different display modes.
[0006] In a first aspect, the embodiments of the present application provide an interface element display method, which comprises: acquiring a target color value corresponding to a target interface element in a target display mode; determining a reverse color value according to the target color value; and performing reverse color processing on the target interface element according to the reverse color value in the case of entering the target display mode, so as to display the target interface element according to the target color value.
[0007] In a second aspect, the embodiments of the present application provide an interface element display device, which comprises: an acquisition module, a determination module, and a processing module; the acquisition module is configured to acquire a target color value corresponding to a target interface element in a target display mode; the determination module is configured to determine a reverse color value according to the target color value; and the processing module is configured to perform reverse color processing on the target interface element according to the reverse color value in the case of entering the target display mode, so as to display the target interface element according to the target color value.
[0008] In a third aspect, an electronic device is provided, which includes a processor and a memory. The memory stores programs or instructions executable by the processor. The programs or instructions, when executed by the processor, implement the steps of the method according to the first aspect.
[0009] In a fourth aspect, a readable storage medium is provided, which stores programs or instructions. The programs or instructions, when executed by a processor, implement the steps of the method according to the first aspect.
[0010] In a fifth aspect, a chip is provided, which includes a processor and a communication interface. The communication interface is coupled to the processor. The processor is configured to execute programs or instructions to implement the method according to the first aspect.
[0011] In a sixth aspect, a computer program product is provided, which is stored in a storage medium. The computer program product is executed by at least one processor to implement the method according to the first aspect.
[0012] In the embodiments of the present application, the target color value corresponding to the target interface element in the target display mode is obtained, the inverse color value is determined according to the target color value, and in the case of entering the target display mode, the target interface element is subjected to inverse color processing according to the inverse color value, so as to display the target interface element according to the target color value. In this way, only the inverse color value needs to be set for the target interface element, and the target interface element can be displayed according to the target color value in the target display mode, thereby reducing the workload of the developer. BRIEF DESCRIPTION OF DRAWINGS
[0013] FIG. 1(a) is a schematic diagram of an interface of an interface element in a light color mode according to the related art;
[0014] FIG. 1(b) is a schematic diagram of an interface of an interface element in a dark color mode according to the related art;
[0015] FIG. 1(c) is a schematic diagram of an interface of an interface element in a dark color mode when a forced inverse color mechanism is in a disabled state according to the related art;
[0016] FIG. 1(d) is a schematic diagram of an interface of an interface element in an ideal display state in a dark color mode;
[0017] Figure 2 FIG. 2 is a flowchart of a method for displaying an interface element according to an embodiment of the present application;
[0018] Figure 3 FIG. 3 is a schematic diagram of a target color value and an inverse color value according to an embodiment of the present application;
[0019] Figure 4is a flowchart of a color value conversion method provided by an embodiment of the present application.
[0020] Figure 5 is a structural diagram of an interface element display device provided by an embodiment of the present application.
[0021] Figure 6 is a structural diagram of an electronic device provided by an embodiment of the present application.
[0022] Figure 7 is a hardware diagram of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION
[0023] The technical solutions in the embodiments of the present application will be clearly described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are some but not all of the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by a person of ordinary skill in the art belong to the scope of protection of the present application.
[0024] The terms "first", "second", and the like in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the terms used in this way can be interchanged under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than that illustrated or described herein, and the objects distinguished by "first", "second", and the like are generally of a kind and are not limited in number, for example, the first object can be one or more. In addition, "and / or" in the specification and claims means at least one of the connected objects, and the character " / " generally represents an "or" relationship between the front and rear associated objects.
[0025] In order to meet the device use requirements of users in dim environments, developers provide resource configurations for interface elements of an application in dark mode. Generally, as long as the developer adds an attribute <item name="android:forceDarkAllowed">true in the application theme, that is, sets the forced reverse color mechanism to an enabled state, when switching from light mode to dark mode, the electronic device can perform forced reverse color processing on each interface element in the application interface through the forced reverse color mechanism, so that each interface element is displayed according to the color values of the dark mode.
[0026] However, if the display effect of a certain interface element in dark mode is not good, the user's visual experience will be greatly reduced. In order to improve this problem, in the related art, it is necessary to first disable the forced reverse color of the interface element, then apply the adaptive color values for dark mode in the design draft to the interface element, and when switching back to light mode, apply the adaptive color values for light mode in the design draft to the interface element.
[0027] While the above method can solve the display problem of interface elements in dark mode, it also prevents the child views of the interface element from having their colors forcibly inverted because the forced color inversion mechanism is disabled.
[0028] For example, as shown in Figure 1(a), taking the dropdown pop-up 11 as an example, the dropdown pop-up 11 is the parent view, and the text option 12 is the child view. In light mode, the dropdown pop-up 11 has a white background, and the text option 12 has black text. As shown in Figure 1(b), if the forced color inversion mechanism is enabled, when switching from light mode to dark mode, the dropdown pop-up 11 changes from a white background to a black background, and the text option 12 changes from black text to white text. As shown in Figure 1(c), if the forced color inversion mechanism is disabled, in dark mode, the dropdown pop-up 11 has a white background, and the text option 12 has black text. As shown in Figure 1(d), this is the ideal display effect of the dropdown pop-up 11 set in the developer's design draft. That is, the dropdown pop-up 11 can display a gray background in dark mode through the adaptive color values developed by the developer, and the text option 12 can still be switched to white text through the forced color inversion mechanism.
[0029] This application provides a method for displaying interface elements, which can achieve the display effect shown in Figure 1(d). The following description, in conjunction with the accompanying drawings, details the interface element display method provided by this application through specific embodiments and application scenarios.
[0030] The interface element display method provided in this application embodiment can be executed by an electronic device or a functional module or entity in an electronic device that can implement the interface element display method. The electronic devices mentioned in this application embodiment include, but are not limited to, mobile phones, tablets, computers, cameras, wearable devices, etc. The interface element display method provided in this application embodiment is described below using an electronic device as the execution subject.
[0031] like Figure 2 As shown, this application embodiment provides a method for displaying interface elements, which may include steps 201-203:
[0032] Step 201: The electronic device obtains the target color value corresponding to the target interface element in the target display mode.
[0033] Optionally, the target color value mentioned above is the ideal value set by the developer for the target interface element in the target display mode. That is, when the target interface element is running in the target display mode, if the color value of the target interface element is the target color value, then the display effect of the target interface element can meet the developer's ideal state.
[0034] Optionally, the target display mode is a display mode that can change display effects by color values, for example, a dark mode, and for example, a light mode, which can be determined according to actual use requirements, and the embodiments of the present application do not make any limitation.
[0035] It should be noted that the dark mode in the embodiments of the present application is a display mode that reduces the stimulation of the display screen on the human eye, which can also be referred to as an eye protection mode, a night mode, etc.
[0036] Optionally, the target interface element can be a view, for example, a control, etc.
[0037] Optionally, the electronic device can obtain the target color value by user triggering, or can obtain the target color value when it is detected that the target interface element needs to be re-adapted to the target display mode. The specific determination can be made according to actual use requirements, and the embodiments of the present application do not make any limitation.
[0038] For example, taking the dark mode as the target display mode. The electronic device can first obtain the color value 1 of the target interface element in the dark mode and the color value 2 in the light mode, and when the difference between the color value 1 and the color value 2 exceeds a preset range, the electronic device can determine that the target interface element needs to be re-adapted to the dark mode, and then the electronic device can obtain the target color value. Alternatively, when the difference between the color value 1 and the color value 2 exceeds the preset range, the electronic device can output a first prompt information, and the user can determine that the target interface element needs to be re-adapted to the dark mode according to the first prompt information, so as to make a first input to the electronic device, and the electronic device can obtain the target color value in response to the first input.
[0039] Optionally, the first prompt information can be text information displayed in the target interface region, or can be voice prompt information, which can be determined according to actual use requirements, and the embodiments of the present application do not make any limitation.
[0040] Step 202, the electronic device determines the anti-color color value according to the target color value.
[0041] Optionally, the electronic device can first determine a first luminance attribute value corresponding to the target color value; then determine a second luminance attribute value according to the first luminance attribute value, the size change of the first luminance attribute value and the second luminance attribute value is inversely proportional; finally, update the target color value according to the second luminance attribute value, so as to obtain the anti-color color value.
[0042] It should be noted that in addition to the luminance attribute, the target color value can also include a plurality of attributes, for example, contrast, saturation, color temperature, hue, etc.
[0043] For example, as Figure 3As shown, taking a color value including a luminance attribute L, an attribute a, and an attribute b as an example. If the target color value is L1a1b1, the electronic device can determine that the first luminance attribute value corresponding to the target color value is L1. Since the size change of the first luminance attribute value and the second luminance attribute value is inversely proportional, the electronic device can determine the second luminance attribute value L2 according to the first luminance attribute value L1. Then, the electronic device can update the luminance attribute value of the target color value from the first luminance attribute value L1 to the second luminance attribute value L2, and determine the updated color value L2a1b1 as the inverse color value.
[0044] Based on the above scheme, since the size change of the first luminance attribute value and the second luminance attribute value is inversely proportional, after determining the first luminance attribute value of the target color value, the second luminance attribute value can be determined according to the first luminance attribute value, so as to determine the inverse color value of the target color value based on the second luminance attribute value.
[0045] Optionally, the target color value can be a color value of a first type. The electronic device determines the first luminance attribute value corresponding to the target color value, which can specifically include: converting the target color value from the first type to a second type; the color value of the second type includes a luminance attribute value; and determining the luminance attribute value included in the converted target color value as the first luminance attribute value corresponding to the target color value.
[0046] It should be noted that the above first type and second type are different representation methods of color values. The color value of the first type can be a representation method suitable for writing code programs in application development, such as the first type being hexadecimal. The color value of the second type can be a representation method convenient for determining the luminance attribute value, such as the second type being a color model Lab.
[0047] It should be noted that Lab is a representation method that can describe all color values that a person with normal vision can see based on the person's perception of color. Among them, L represents the luminance attribute value, the range of the luminance attribute value is (0, 110), a represents the range of red to green, and b represents the range of blue to yellow.
[0048] For example, the electronic device can first convert the target color value from hexadecimal to Lab, and then determine the first luminance attribute value corresponding to the target color value.
[0049] Based on the above scheme, since the color value of the second type includes a luminance attribute value, after converting the target color value from the first type to the second type, it is more convenient to determine the first luminance attribute value corresponding to the target color value.
[0050] Optionally, the electronic device determines the second luminance attribute value according to the first luminance attribute value, specifically can include: the electronic device obtains a luminance attribute threshold value; and determines the second luminance attribute value according to the luminance attribute threshold value and the first luminance attribute value.
[0051] Optionally, the luminance attribute threshold value is a maximum value of the luminance attribute, for example, when the color value is expressed in Lab form, since the range of the luminance attribute value of Lab is (0, 110), 110 can be determined as the luminance attribute threshold value.
[0052] Exemplarily, as shown in Figure 4 The electronic device can first convert the target color value from hexadecimal to Lab color value, after conversion, the electronic device can determine the first luminance attribute value L1 from the target color value expressed in Lab color value, then calculate the difference between 110 and the first luminance attribute value L1 to obtain the second luminance attribute value L2. After that, the electronic device can update the luminance attribute value of the target color value from the first luminance attribute value L1 to the second luminance attribute value L2, and determine the color value obtained after updating as the inverse color color value. Finally, convert the inverse color color value expressed in Lab color value to the inverse color color value expressed in hexadecimal.
[0053] Based on the above scheme, since the second luminance attribute value can be determined according to the luminance attribute threshold value and the first luminance attribute value, the inverse color color value can be determined, thereby providing a data basis for the operation of the forced inverse color mechanism.
[0054] Step 203, in the case of entering the target display mode, the electronic device performs inverse color processing on the target interface element according to the inverse color color value, so as to display the target interface element according to the target color value.
[0055] Optionally, in the case that the target display mode is a dark mode, the electronic device can perform inverse color processing on the target interface element according to the inverse color color value in the case of switching from the light mode to the dark mode, so as to display the target interface element according to the target color value.
[0056] Exemplarily, taking the case that the electronic device enters the dark mode from the light mode as an example, the electronic device can obtain the target color value corresponding to the target interface element in the dark mode, then determine the inverse color color value corresponding to the target interface element in the light mode according to the target color value, and update the color value of the target interface element in the light mode to the inverse color color value, when the target interface element is switched from the light mode to the dark mode, the electronic device can perform inverse color processing on the target interface element, so that the target interface element is displayed according to the target color value in the dark mode.
[0057] Based on the above scheme, since in the case that the target display mode is a dark mode, the electronic device can perform reverse color processing on the target interface element according to the reverse color value in the case that the light mode is switched to the dark mode, so that the target interface element is displayed according to the target color value, and therefore, the rational display of the target interface element in the dark mode can be realized without affecting the child view.
[0058] In the embodiment of the present application, the target color value corresponding to the target interface element in the target display mode is obtained, the reverse color value is determined according to the target color value, and in the case of entering the target display mode, the target interface element is processed according to the reverse color value to display the target interface element according to the target color value. In this way, only the reverse color value needs to be set for the target interface element, so that the target interface element can be displayed according to the target color value in the target display mode, thereby reducing the workload of the developer.
[0059] The embodiment of the present application provides an interface element display method, which can include:
[0060] Step 301, obtaining a target color value corresponding to a target interface element in a dark mode; the target color value is a first type of color value;
[0061] Step 302, converting the target color value from the first type to a second type; the second type of color value includes a brightness attribute value; a first brightness attribute value corresponding to the target color value is determined according to the brightness attribute value included in the converted target color value;
[0062] Step 303, obtaining a brightness attribute threshold value; determining a second brightness attribute value according to the brightness attribute threshold value and the first brightness attribute value, the size change of the first brightness attribute value and the second brightness attribute value is inversely proportional;
[0063] Step 304, updating the target color value according to the second brightness attribute value to obtain the reverse color value.
[0064] Step 305, in the case of switching from a light mode to the dark mode, performing reverse color processing on the target interface element according to the reverse color value to display the target interface element according to the target color value.
[0065] Optionally, when the target interface element is the interface background and the target display mode is dark mode, the electronic device can obtain the target color value corresponding to the interface background in dark mode. This target color value can be a hexadecimal color value. Then, the electronic device can first convert the target color value from hexadecimal to Lab color value, and then determine a first brightness attribute value L1 from the converted target color value. Since the brightness attribute value range of Lab color value is (0, 110), the electronic device can determine the difference between the brightness attribute threshold 110 and the first brightness attribute value L1 as a second brightness attribute value L2. Then, the brightness attribute value of the target color value is updated from the first brightness attribute value L1 to the second brightness attribute value L2, and the updated color value is determined as the inverted color value. Afterward, the electronic device can convert the determined inverted color value from Lab color value back to a hexadecimal color value, and update the color value of the interface background in light mode to this inverted color value. When the interface background switches from light mode to dark mode, the electronic device can perform color inversion processing on the interface background, thereby displaying the interface background according to the target color value in dark mode.
[0066] In this embodiment, since the electronic device can invert the background color according to the inverted color value when the target display mode is dark mode, so that the background color is displayed according to the target color value, the rational display of the target interface elements in dark mode can be achieved without affecting the child view.
[0067] The interface element display method provided in this application can be executed by an interface element display device. This application uses an interface element display device executing the interface element display method as an example to illustrate the interface element display device provided in this application.
[0068] like Figure 5 As shown in the figure, this application embodiment also provides an interface element display device 500, including: an acquisition module 501, a determination module 502 and a processing module 503.
[0069] The acquisition module 501 is used to acquire the target color value corresponding to the target interface element in the target display mode;
[0070] The determining module 502 is used to determine the inverse color value based on the target color value;
[0071] The processing module 503 is used to perform color inversion processing on the target interface elements according to the inverted color value when entering the target display mode, so as to display the target interface elements according to the target color value.
[0072] Optionally, the determining module 502 is specifically configured to determine a first luminance attribute value corresponding to the target color value; determine a second luminance attribute value according to the first luminance attribute value, the first luminance attribute value and the second luminance attribute value being inversely proportional in size variation; and update the target color value according to the second luminance attribute value to obtain the reverse color value.
[0073] Optionally, the target color value is a color value of a first type; the determining module 502 is specifically configured to convert the target color value from the first type to a second type, the color value of the second type including a luminance attribute value; and determine the luminance attribute value included in the converted target color value as the first luminance attribute value corresponding to the target color value.
[0074] Optionally, the obtaining module 501 is further configured to obtain a luminance attribute threshold value; and the determining module 502 is further configured to determine the second luminance attribute value according to the luminance attribute threshold value and the first luminance attribute value.
[0075] Optionally, the target display mode is a dark mode; and the processing module 503 is further configured to, in a case of switching from a light mode to the dark mode, perform reverse color processing on the target interface element according to the reverse color value, so as to display the target interface element according to the target color value.
[0076] In the embodiments of the present application, a target color value corresponding to a target interface element in a target display mode is obtained, a reverse color value is determined according to the target color value, and in a case of entering the target display mode, reverse color processing is performed on the target interface element according to the reverse color value, so as to display the target interface element according to the target color value. In this way, only the reverse color value needs to be set for the target interface element, so that the target interface element can be displayed according to the target color value in the target display mode, thereby reducing the workload of the developer.
[0077] The interface element display apparatus in the embodiments of the present application can be an electronic device or a component in an electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal or other device than a terminal. For example, the electronic device can be a mobile phone, a tablet computer, a notebook computer, a palm computer, a vehicle-mounted electronic device, a Mobile Internet Device (MID), an augmented reality (AR) / virtual reality (VR) device, a robot, a wearable device, an ultra-mobile personal computer (UMPC), a netbook, a personal digital assistant (PDA), or the like, and can also be a server, a Network Attached Storage (NAS), a personal computer (PC), a television (TV), a teller machine, or a self-service machine, and the like, and the embodiments of the present application are not limited in this regard.
[0078] The interface element display apparatus in the embodiments of the present application can be an apparatus having an operating system. The operating system can be an Android operating system, an iOS operating system, or other possible operating system, and the embodiments of the present application are not limited in this regard.
[0079] The interface element display apparatus provided in the embodiments of the present application can implement the processes of the method embodiments of FIG. 1 to Figure 4 For brevity, the processes are not described herein again.
[0080] Optionally, as shown in Figure 6 The embodiments of the present application further provide an electronic device 600, which includes a processor 601 and a memory 602, and the memory 602 stores programs or instructions executable on the processor 601. When the programs or instructions are executed by the processor 601, each step of the above-mentioned interface element display method embodiments is implemented, and the same technical effects are achieved. For brevity, the processes are not described herein again.
[0081] It should be noted that the electronic device in the embodiments of the present application includes the mobile electronic device and the non-mobile electronic device described above.
[0082] Figure 7 To implement the hardware structure of an electronic device according to an embodiment of the present application.
[0083] The electronic device 1000 includes, but is not limited to, a radio frequency unit 1001, a network module 1002, an audio output unit 1003, an input unit 1004, a sensor 1005, a display unit 1006, a user input unit 1007, an interface unit 1008, a storage 1009, and a processor 1010, etc.
[0084] Those skilled in the art can understand that the electronic device 1000 can further include a power supply (such as a battery) for supplying power to each component, and the power supply can be logically connected to the processor 1010 through a power management system, so as to realize functions such as management of charging, discharging, and power consumption management through the power management system. Figure 7 The electronic device structure shown in the figure does not constitute a limitation on the electronic device, and the electronic device can include more or fewer components than shown, or combine certain components, or different component arrangements, which are not described here.
[0085] The processor 1010 is configured to: obtain a target color value corresponding to a target interface element in a target display mode; determine an inverse color color value according to the target color value; and perform inverse color processing on the target interface element according to the inverse color color value to display the target interface element according to the target color value in the case of entering the target display mode.
[0086] In the embodiments of the present application, the target color value corresponding to the target interface element in the target display mode is obtained, the inverse color color value is determined according to the target color value, and the target interface element is processed according to the inverse color color value to display the target interface element according to the target color value in the case of entering the target display mode. Thus, only the inverse color color value of the target interface element needs to be set to make the target interface element display according to the target color value in the target display mode, thereby reducing the workload of the developer.
[0087] Optionally, the processor 1010 is specifically configured to determine a first luminance attribute value corresponding to the target color value; determine a second luminance attribute value according to the first luminance attribute value, the size change of the first luminance attribute value and the second luminance attribute value being inversely proportional; and update the target color value according to the second luminance attribute value to obtain the inverse color color value.
[0088] In the embodiments of the present application, since the size change of the first luminance attribute value and the second luminance attribute value is inversely proportional, after the first luminance attribute value of the target color value is determined, the second luminance attribute value can be determined according to the first luminance attribute value, so as to determine the inverse color color value of the target color value based on the second luminance attribute value.
[0089] Optionally, the target color value is a color value of a first type; the processor 1010 is specifically configured to: convert the target color value from the first type to a second type; the color value of the second type comprises a luminance attribute value; and determine the luminance attribute value comprised in the converted target color value as a first luminance attribute value corresponding to the target color value.
[0090] In the embodiment of the present application, since the color value of the second type comprises the luminance attribute value, after the target color value is converted from the first type to the second type, the first luminance attribute value corresponding to the target color value can be determined more conveniently.
[0091] Optionally, the processor 1010 is configured to: obtain a luminance attribute threshold value; and determine the second luminance attribute value according to the luminance attribute threshold value and the first luminance attribute value.
[0092] In the embodiment of the present application, since the second luminance attribute value can be determined according to the luminance attribute threshold value and the first luminance attribute value, the inverse color color value can be determined, thereby providing a data basis for the operation of the forced inverse color mechanism.
[0093] Optionally, the target display mode is a dark mode; and the processor 1010 is further configured to: in a case where the target display mode is switched from a light mode to the dark mode, perform inverse color processing on the target interface element according to the inverse color color value, so as to display the target interface element according to the target color value.
[0094] In the embodiment of the present application, since in a case where the target display mode is the dark mode, the electronic device can perform inverse color processing on the target interface element according to the inverse color color value in a case where the target display mode is switched from the light mode to the dark mode, so as to display the target interface element according to the target color value, the rational display of the target interface element in the dark mode can be implemented without affecting the child view.
[0095] It should be understood that in the embodiments of the present application, the input unit 1004 can include a graphics processor (GPU) 10041 and a microphone 10042. The graphics processor 10041 processes image data of a still picture or a video obtained by an image capture device (such as a camera) in a video capture mode or an image capture mode. The display unit 1006 can include a display panel 10061, which can be configured in the form of a liquid crystal display, an organic light-emitting diode, or the like. The user input unit 1007 includes at least one of a touch panel 10071 and other input devices 10072. The touch panel 10071 is also referred to as a touch screen. The touch panel 10071 can include two parts of a touch detection device and a touch controller. The other input devices 10072 can include, but are not limited to, a physical keyboard, function keys (such as volume control keys, on-off keys, etc.), a trackball, a mouse, a joystick, and the like, which will not be described here.
[0096] The memory 1009 can be used to store software programs and various data. The memory 1009 can mainly include a first storage area storing programs or instructions and a second storage area storing data, wherein the first storage area can store an operating system, application programs or instructions required by at least one function (such as a sound playing function, an image playing function, etc.), and the like. In addition, the memory 1009 can include a volatile memory or a non-volatile memory, or the memory 1009 can include both volatile and non-volatile memories. The non-volatile memory can be a Read-Only Memory (ROM), a Programmable ROM (PROM), an Erasable PROM (EPROM), an Electrically EPROM (EEPROM), or a flash memory. The volatile memory can be a Random Access Memory (RAM), a Static RAM (SRAM), a Dynamic RAM (DRAM), a Synchronous DRAM (SDRAM), a Double Data Rate SDRAM (DDR SDRAM), an Enhanced SDRAM (ESDRAM), a Synch link DRAM (SLDRAM), and a Direct Rambus RAM (DRRAM). The memory 1009 in the embodiments of the present application includes but is not limited to these and any other suitable types of memories.
[0097] The processor 1010 can include one or more processing units; optionally, the processor 1010 integrates an application processor and a modem processor, wherein the application processor mainly processes operations related to an operating system, a user interface, and an application program, and the modem processor mainly processes wireless communication signals, such as a baseband processor. It can be understood that the above-mentioned modem processor can also not be integrated into the processor 1010.
[0098] The embodiments of the present application also provide a readable storage medium, the readable storage medium stores programs or instructions, the programs or instructions are executed by a processor to realize each process of the above-mentioned interface element display method embodiments, and the same technical effects can be achieved. To avoid repetition, details are not described here.
[0099] The processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes a computer readable storage medium, such as a computer readable only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0100] The embodiment of the present application further provides a chip, which comprises a processor and a communication interface, the communication interface is coupled with the processor, the processor is used for running programs or instructions to realize the processes of the interface element display method embodiments and achieve the same technical effects. To avoid repetition, details are not described here.
[0101] It should be understood that the chip mentioned in the embodiment of the present application can also be referred to as a system level chip, a system chip, a chip system or a system on chip, etc.
[0102] The embodiment of the present application provides a computer program product, which is stored in a storage medium, and is executed by at least one processor to realize the processes of the interface element display method embodiments and achieve the same technical effects. To avoid repetition, details are not described here.
[0103] It should be noted that in this paper, the term "include", "contain" or any other variant thereof is intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements not only includes those elements, but also includes other elements not explicitly listed, or includes elements inherent to such process, method, article or device. Without more limitations, the element defined by the statement "including a" does not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the method and device in the embodiment of the present application is not limited to the order of the functions shown or discussed, but can also include the functions performed in a substantially simultaneous manner or in the opposite order according to the functions involved, for example, the described method can be performed in an order different from the described order, and various steps can also be added, omitted or combined. In addition, the features described with reference to some examples can be combined in other examples.
[0104] Through the above description of the embodiments, those skilled in the art can clearly understand that the above-mentioned example methods can be realized by means of software and a necessary general hardware platform, and of course, can also be realized by hardware, but in many cases, the former is a better embodiment. Based on such understanding, the technical solutions of the present application can be embodied in the form of a computer software product in essence or in the form of a contribution to the related art. The computer software product is stored in a storage medium (such as a ROM / RAM, a magnetic disc, an optical disc), and includes a plurality of instructions for causing a terminal (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in the various embodiments of the present application.
[0105] The embodiments of the present application are described above in combination with the drawings, but the present application is not limited to the above-mentioned specific embodiments, and the above-mentioned specific embodiments are only illustrative and not restrictive. Those skilled in the art can make many forms under the inspiration of the present application without departing from the scope of the present application and the scope protected by the claims.
Claims
1. An interface element display method characterized by, The method comprises the following steps: In the case that the forced reverse color mechanism of the parent view is in the disabled state, a target color value corresponding to a target interface element in the dark mode is obtained, the target interface element belongs to a child view; A reverse color value is determined according to the target color value; In the case that the light mode is switched to the dark mode, the target interface element is subjected to reverse color processing according to the reverse color value, so that the target interface element is displayed in the target color value.
2. The interface element display method according to claim 1, wherein The determination of the reverse color value according to the target color value comprises the following steps: A first luminance attribute value corresponding to the target color value is determined; A second luminance attribute value is determined according to the first luminance attribute value, the first luminance attribute value and the second luminance attribute value are inversely proportional in size change; The target color value is updated according to the second luminance attribute value to obtain the reverse color value.
3. The interface element display method according to claim 2, wherein The target color value is a first type of color value; The determination of the first luminance attribute value corresponding to the target color value comprises the following steps: The target color value is converted from the first type to a second type; the color value of the second type comprises a luminance attribute value; The luminance attribute value included in the converted target color value is determined as the first luminance attribute value corresponding to the target color value.
4. The interface element display method of claim 2, wherein, The determination of the second luminance attribute value according to the first luminance attribute value comprises the following steps: A luminance attribute threshold value is obtained; The second luminance attribute value is determined according to the luminance attribute threshold value and the first luminance attribute value.
5. An interface element display device, characterized by The method comprises the following steps: An acquisition module, a determination module and a processing module are provided; The acquisition module is configured to, in the case that the forced reverse color mechanism of the parent view is in the disabled state, acquire a target color value corresponding to a target interface element in the dark mode, the target interface element belonging to a child view; The determination module is configured to determine a reverse color value according to the target color value; The processing module is configured to, in the case that the light mode is switched to the dark mode, perform reverse color processing on the target interface element according to the reverse color value, so that the target interface element is displayed in the target color value.
6. The interface element display apparatus according to claim 5, wherein The determination module is specifically configured to determine a first luminance attribute value corresponding to the target color value; determine a second luminance attribute value according to the first luminance attribute value, the first luminance attribute value and the second luminance attribute value being inversely proportional in size change; and update the target color value according to the second luminance attribute value to obtain the reverse color value.
7. The interface element display apparatus of claim 6, wherein The target color value is a first type of color value; the determination module is specifically configured to: Convert the target color value from the first type to a second type; the color value of the second type comprises a luminance attribute value; Determine the luminance attribute value included in the converted target color value as the first luminance attribute value corresponding to the target color value.
8. An electronic device, comprising: The device comprises a processor and a memory, the memory stores programs or instructions executable on the processor, and the programs or instructions are executed by the processor to implement the interface element display method of any one of claims 1-4.
9. A readable storage medium, characterized by, The readable storage medium stores programs or instructions, and the programs or instructions are executed by the processor to implement the interface element display method of any one of claims 1-4.
Citation Information
Patent Citations
Display method and device
CN110162364A
Interface processing method and device, electronic device and computer readable storage medium
CN111857912A
Picture processing method, related device, equipment and storage medium
CN115294363A