Dynamic adjustment method and system of self-adaptive user interface
Through real -time monitoring and analysis of the contrast of user interface elements, and formulating scientific color adjustment strategies, it solves the problem of insufficient contrast in the design of traditional user interface, and realizes the good contrast and dynamic adjustment effect of interface elements in different environments.
Patent Information
- Application Number
- CN202411896714.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-23
- Publication Date
- 2025-01-24
- Estimated Expiration
- 2044-12-23
AI Technical Summary
Traditional user interface design methods are difficult to ensure that interface elements maintain good contrast in different environments, affecting user efficiency and comfort, and it is difficult to make frequent adjustments and optimizations efficiently and accurately.
Provide a dynamic adjustment method for adaptive user interfaces, through real -time monitoring and analysis of the contrast of interface elements, formulate a scientific color adjustment strategy according to the preset standard value, including color adjustment direction, number and target color, and through gradual adjustment Implement dynamic adjustment of contrast.
Ensure that interface elements can maintain good contrast in different environments, improve user use efficiency and comfort, and realize dynamic and adaptive color contrast adjustments.
Smart Images

Figure CN119356788A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of user interface design, and in particular to a method and system for dynamically adjusting an adaptive user interface. Background Art
[0002] With the rapid development of digital technology, the design of user interface (UI) has become increasingly important. It not only affects the user experience, but also directly affects the market competitiveness of products. In user interface design, the contrast of elements is one of the key factors to ensure information readability and visual appeal. However, in actual applications, due to the diversity of design elements and differences in user environments, the contrast of interface elements is often insufficient, which in turn affects the user's efficiency and comfort.
[0003] Traditional user interface design methods often rely on the designer's experience and subjective judgment, and lack a scientific and systematic contrast adjustment mechanism. This makes it difficult to ensure that all elements maintain good contrast in different environments after the interface design is completed. In addition, with the continuous changes in user needs and the continuous advancement of technology, interface elements may need to be frequently adjusted and optimized, and traditional methods often fail to complete this task efficiently and accurately.
[0004] Therefore, it is necessary to provide a method and system for dynamically adjusting an adaptive user interface to solve the above technical problems. Summary of the invention
[0005] In order to solve the above technical problems, the present invention provides a dynamic adjustment method and system of an adaptive user interface, which can monitor and analyze the contrast of interface elements in real time, and formulate a scientific color adjustment strategy according to preset standard values to ensure that the elements can maintain good contrast in different environments. The present invention provides a method for dynamically adjusting an adaptive user interface, the method comprising the following steps: Extract the RGB color values of the foreground and background of each element from the user interface, and convert the RGB color values of the foreground and background into corresponding HSV color values respectively; Calculating the contrast ratio of the corresponding element based on the RGB color value and the HSV color value, and determining whether the contrast ratio of the element meets a preset standard value; When the contrast ratio of the element does not meet the preset standard value, a color adjustment strategy is formulated based on the contrast ratio of the corresponding element, wherein the color adjustment strategy includes a color adjustment direction, a color adjustment number, and a target color; In the color adjustment direction, the RGB color value of the corresponding element is progressively adjusted according to the color adjustment times until the RGB color value gradually transitions to the target color.
[0006] Preferably, the RGB color value is converted to the HSV color value using the following formula: ; ; The calculation of depends on the location of the maximum value, specifically: like ,but ; like ,but ; like ,but ; in, is the red component in the RGB color value, is the green component in the RGB color value, is the blue component in the RGB color value, is the hue in the HSV color value, is the brightness in the HSV color value, is the saturation in the HSV color value, For color difference.
[0007] Preferably, the calculating the contrast ratio of the corresponding element based on the RGB color value and the HSV color value, and judging whether the contrast ratio of the element meets a preset standard value, includes: The RGB contrast ratio is calculated based on the foreground and background in the RGB color value, and the calculation formula is: in, is the brightness of the foreground RGB color value, is the brightness of the background's RGB color value, is the RGB contrast ratio; The HSV contrast ratio is calculated based on the foreground and background in the HSV color value, and the calculation formula is: in, is the brightness of the foreground HSV color value, is the brightness of the background in HSV color value, is the HSV contrast ratio; The contrast ratio of the element is obtained by weighted calculation based on the RGB contrast ratio and the HSV contrast ratio , and its calculation formula is: in, and The preset weights for the RGB contrast ratio and the HSV contrast ratio respectively; It is determined whether the contrast ratio of the element obtained by weighted calculation is lower than a preset standard value. If it is lower than the preset standard value, the element is marked as an object that needs to be adjusted.
[0008] Preferably, when the contrast ratio of an element does not meet a preset standard value, formulating a color adjustment strategy based on the contrast ratio of the corresponding element includes: Determining the direction to be adjusted according to the contrast ratio of the element to obtain a color adjustment direction, wherein the color adjustment direction includes increase and decrease; Calculating a color change amplitude based on the RGB color value and the HSV color value, and determining a color adjustment number based on the color change amplitude, wherein the color change amplitude includes an RGB color change distance and an HSV color change distance; The RGB value of the target color is calculated according to the target brightness value, wherein the target brightness value is determined based on a preset standard value.
[0009] Preferably, the calculating the color change amplitude based on the RGB color value and the HSV color value, and determining the number of color adjustments based on the color change amplitude, includes: For the RGB color change distance, the calculation formula is: in, and are the red components of the foreground and background, respectively. and are the green components of the foreground and background, respectively. and are the blue components of foreground and background respectively; The calculation formula for the HSV color change distance is: in, and are the hues of the foreground and background, and are the saturation of foreground and background, respectively. and are the brightness of foreground and background, respectively; For the color change range , and its calculation formula is: The color adjustment times are determined according to a preset segmented adjustment function, wherein the segmented adjustment function is: in, and are preset thresholds. , , and It is the preset parameter.
[0010] Preferably, the RGB value of the target color is calculated according to the target brightness value, wherein the target brightness value is determined based on a preset standard value, including: Determine a target brightness value based on a preset standard value; Calculate the brightness adjustment ratio based on the target brightness value , and its calculation formula is: in, is the target brightness value; The RGB value of the target color is calculated according to the brightness adjustment ratio, and the calculation formula is: .
[0011] Preferably, in the color adjustment direction, the RGB color value of the corresponding element is adjusted progressively according to the number of color adjustments until the RGB color value gradually transitions to the target color, including: Calculate the brightness change step size for each adjustment according to the color adjustment times and the target brightness value; In the color adjustment direction, the RGB value of the foreground is adjusted successively according to the color adjustment times and the step size of each adjustment until the RGB value of the target color is reached, wherein the RGB value adjustment formula of the foreground is: in, , and are the RGB values of the target color, is the brightness change step size, The brightness of the foreground RGB color value.
[0012] The present invention also provides a dynamic adjustment system of an adaptive user interface, which is used to execute the dynamic adjustment method of an adaptive user interface, and the dynamic adjustment system includes: A color value extraction module is used to extract the RGB color values of the foreground and background of each element on the user interface, and convert the RGB color values of the foreground and background into corresponding HSV color values respectively; A contrast evaluation module, used to calculate the contrast ratio of the corresponding element based on the RGB color value and the HSV color value, and determine whether the contrast ratio of the element meets a preset standard value; An adjustment strategy formulation module, used for formulating a color adjustment strategy based on the contrast ratio of the corresponding element when the contrast ratio of the element does not meet the preset standard value, wherein the color adjustment strategy includes a color adjustment direction, a color adjustment number and a target color; The color adjustment module is used to progressively adjust the RGB color value of the corresponding element in the color adjustment direction according to the color adjustment times until the RGB color value gradually transitions to the target color.
[0013] Compared with the related art, the method and system for dynamically adjusting an adaptive user interface provided by the present invention have the following beneficial effects: The present invention extracts the foreground and background color values of the interface elements and converts them into HSV color space for analysis to more accurately evaluate the color contrast. At the same time, the contrast ratio of the two color spaces RGB and HSV is combined to obtain the comprehensive contrast of the elements through weighted calculation, thereby more comprehensively reflecting the visual presentation effect of the elements. When the contrast does not meet the preset standard, the present invention can automatically formulate a color adjustment strategy, including the color adjustment direction, number of times and target color, and gradually transition the RGB color value of the interface element to the target color through progressive adjustment, thereby achieving dynamic and adaptive color contrast adjustment. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] Figure 1 A flowchart of a method for dynamically adjusting an adaptive user interface provided by the present invention; Figure 2 A schematic diagram of the module structure of a dynamic adjustment system for an adaptive user interface provided by the present invention. DETAILED DESCRIPTION
[0015] The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the present invention, rather than to limit the present invention. It should also be noted that, for ease of description, only the parts related to the present invention, rather than all structures, are shown in the accompanying drawings. In addition, the embodiments of the present invention and the features in the embodiments may be combined with each other without conflict.
[0016] It should also be noted that, for ease of description, only the parts related to the present invention, but not all of the contents, are shown in the accompanying drawings. Before discussing the exemplary embodiments in more detail, it should be mentioned that some exemplary embodiments are described as processes or methods depicted as flow charts. Although the flow charts describe the operations (or steps) as sequential processes, many of the operations therein can be implemented in parallel, concurrently or simultaneously. In addition, the order of the operations can be rearranged. The process can be terminated when its operation is completed, but it can also have additional steps not included in the accompanying drawings. The process can correspond to methods, functions, procedures, subroutines, subprograms, etc.
[0017] Embodiment 1 The present invention provides a method for dynamically adjusting an adaptive user interface. Figure 1 As shown, the dynamic adjustment method includes the following steps: S1: extracting the RGB color values of the foreground and background of each element from the user interface, and converting the RGB color values of the foreground and background into corresponding HSV color values, respectively.
[0018] In this embodiment, the RGB color values of the foreground and background are first extracted from each element of the user interface. This step can be completed by a graphics library in a programming language, for example, using DOM operations in JavaScript to obtain the style attributes of the element, or using an API provided by the platform in a mobile application to obtain the color information of the view.
[0019] After extracting the RGB color value, you need to convert it to HSV color value. The HSV color model is more in line with the way humans perceive color and can better represent the hue, saturation, and brightness of the color.
[0020] Specifically, the formula for converting RGB color value to HSV color value is: ; ; The calculation of depends on the location of the maximum value, specifically: like ,but ; like ,but ; like ,but ; in, is the red component in the RGB color value, is the green component in the RGB color value, is the blue component in the RGB color value, is the hue in the HSV color value, is the brightness in the HSV color value, is the saturation in the HSV color value, For color difference.
[0021] By extracting the RGB color values of the foreground and background of each element on the user interface and converting them to HSV color values, the characteristics of the color can be described more comprehensively. The RGB color model focuses on the red, green, and blue components of the color, while the HSV color model focuses on the hue, saturation, and brightness of the color, and is more suitable for color contrast calculation and adjustment. The technical effect of this step is to provide accurate and comprehensive color information for subsequent contrast calculation and color adjustment, ensuring the scientificity and reliability of the entire dynamic adjustment process.
[0022] S2: Calculate the contrast ratio of the corresponding element based on the RGB color value and the HSV color value, and determine whether the contrast ratio of the element meets a preset standard value.
[0023] Specifically, step S2 includes the following steps: S21: Calculate the RGB contrast ratio based on the foreground and background in the RGB color value, and the calculation formula is: in, is the brightness of the foreground RGB color value, is the brightness of the background's RGB color value, is the RGB contrast ratio.
[0024] at the same time, and The calculation formulas are: in, and are the red components of the foreground and background, respectively. and are the green components of the foreground and background, respectively. and are the blue components of the foreground and background respectively, where , and These coefficients are defined according to the ITU-R BT.709 standard (also known as Rec. 709), which is widely used in digital video and image processing. These coefficients ensure that the brightness values better reflect the human eye's perception of different colors.
[0025] In this embodiment, by calculating the RGB contrast ratio, the contrast between the foreground and background colors can be quantified, thereby providing basic data for subsequent contrast evaluation and color adjustment. This method is simple and efficient and is applicable to most color combinations.
[0026] S22: Calculate the HSV contrast ratio based on the foreground and background in the HSV color value, and the calculation formula is: in, is the brightness of the foreground HSV color value, is the brightness of the background in HSV color value, is the HSV contrast ratio.
[0027] In this embodiment, by calculating the HSV contrast ratio, the contrast between the foreground and background colors can be more accurately evaluated, especially in cases where the color saturation and hue are greatly different. This helps improve the readability and accessibility of the user interface.
[0028] exist and In the calculation formula, 0.05 is added to the numerator and denominator to avoid division by zero errors and to make the calculation of the contrast ratio smoother and more stable. If the brightness values of the foreground and background are very close or equal, directly calculating the contrast ratio may cause the denominator to be close to zero, thus causing division by zero errors. Adding 0.05 ensures that the denominator is always greater than zero.
[0029] S23: Obtaining the contrast ratio of the element by weighted calculation based on the RGB contrast ratio and the HSV contrast ratio , and its calculation formula is: in, and They are the preset weights for RGB contrast ratio and HSV contrast ratio respectively.
[0030] In this embodiment, the following weight values are determined after experiments and user feedback: , , these weight values mean that when calculating the final contrast ratio, the RGB contrast ratio accounts for 70% of the weight and the HSV contrast ratio accounts for 30% of the weight. This setting takes into account both the universal applicability of the RGB model and the advantages of the HSV model in special color combinations.
[0031] The contrast ratio obtained through weighted calculation is more comprehensive and accurate, and can better reflect the contrast between foreground and background colors. This helps ensure that the visual effect of the user interface meets the preset standard value, improving the user's visual experience and the readability of the interface.
[0032] S24: Determine whether the contrast ratio of the element obtained by weighted calculation is lower than a preset standard value. If it is lower than the preset standard value, mark the element as an object that needs to be adjusted.
[0033] In order to ensure that the visual effect of the user interface meets the preset standard value, the calculated contrast ratio needs to be judged. If the contrast ratio is lower than the preset standard value, the color of the element needs to be adjusted to improve the contrast.
[0034] In this embodiment, it is first determined whether the contrast ratio obtained by weighted calculation is lower than a preset standard value. If it is, the element is marked as an object that needs to be adjusted. By determining whether the contrast ratio meets the preset standard value, the interface elements that need color adjustment can be accurately identified. This helps to ensure that the contrast of all interface elements meets the preset requirements, thereby improving the overall visual effect and user experience of the user interface.
[0035] S3: When the contrast ratio of the element does not meet the preset standard value, a color adjustment strategy is formulated based on the contrast ratio of the corresponding element, wherein the color adjustment strategy includes a color adjustment direction, a color adjustment number, and a target color.
[0036] Specifically, step S3 includes the following steps: S31: determining a direction to be adjusted according to the contrast ratio of the element, and obtaining a color adjustment direction, wherein the color adjustment direction includes increase and decrease.
[0037] In user interface design, the contrast between foreground and background colors directly affects the user's visual experience. If the contrast is too low, users may have difficulty distinguishing the foreground from the background, resulting in reading difficulties. Therefore, it is necessary to determine the direction of color adjustment based on the contrast ratio to improve the contrast. The adjustment direction can be to increase or decrease the brightness, depending on the brightness value of the current color and the target brightness value.
[0038] In this embodiment, when it is determined that adjustment is required, the direction of adjustment is determined according to the contrast ratio: If the foreground color is too light (high brightness), you need to reduce the brightness of the foreground color, that is, reduce the brightness.
[0039] If the foreground color is too dark (low brightness), you need to increase the brightness of the foreground color, that is, increase the brightness.
[0040] S32: Calculating a color change amplitude based on the RGB color value and the HSV color value, and determining the number of color adjustments based on the color change amplitude, wherein the color change amplitude includes an RGB color change distance and an HSV color change distance.
[0041] In order to achieve smooth color adjustment, it is necessary to calculate the amplitude of color change and determine the number of adjustments based on the amplitude. The color change amplitude includes the RGB color change distance and the HSV color change distance, which can reflect the difference between the foreground and background colors. By determining the number of adjustments, it can be ensured that each step in the color adjustment process is gradual and avoids abrupt changes.
[0042] Specifically, in step S32, the calculation formulas of various values are as follows: For the RGB color change distance, the calculation formula is: in, and are the red components of the foreground and background, respectively. and are the green components of the foreground and background, respectively. and The blue components of the foreground and background respectively.
[0043] The calculation formula for the HSV color change distance is: in, and are the hues of the foreground and background, and are the saturation of foreground and background, respectively. and are the brightness of foreground and background respectively.
[0044] For the color change range , and its calculation formula is: The color adjustment times are determined according to a preset segmented adjustment function, wherein the segmented adjustment function is: in, and are preset thresholds. , , and It is the preset parameter.
[0045] In this formula, according to the color change amplitude Calculating the number of color adjustments in the interval can ensure that each step in the color adjustment process is gradual and avoids abrupt changes, which helps to achieve smooth color transitions and improve the visual effects and user experience of the user interface.
[0046] S33: Calculating the RGB value of the target color according to the target brightness value, wherein the target brightness value is determined based on a preset standard value.
[0047] In order to ensure that the adjusted color can reach the preset standard value, the RGB value of the target color needs to be calculated. The target brightness value is determined according to the preset standard value, which is a fixed brightness value, such as = 128. By calculating the target brightness value, you can ensure that the adjusted color has appropriate brightness, thereby improving the contrast.
[0048] Specifically, step S33 includes the following steps: S33a: Determine a target brightness value based on a preset standard value.
[0049] S33b: Calculating the brightness adjustment ratio based on the target brightness value , and its calculation formula is: in, is the target brightness value.
[0050] S33c: Calculate the RGB value of the target color according to the brightness adjustment ratio, and the calculation formula is: .
[0051] In this embodiment, by calculating the RGB value of the target color, it is possible to ensure that the adjusted color has a suitable brightness, thereby improving the contrast, which helps to ensure that the visual effect of the user interface meets the preset standard value, improving the user's visual experience and the readability of the interface.
[0052] S4: In the color adjustment direction, progressively adjust the RGB color value of the corresponding element according to the number of color adjustments, until the RGB color value gradually transitions to the target color.
[0053] Specifically, step S4 includes the following steps: S41: Calculating the brightness change step length of each adjustment according to the color adjustment times and the target brightness value.
[0054] In this embodiment, in order to achieve a smooth transition effect during the color adjustment process, the color adjustment needs to be decomposed into multiple steps. In each step, the color change should be gradual, so as to avoid visual discomfort caused by color mutation. Calculating the brightness change step size for each adjustment is a key step to achieve this goal.
[0055] By calculating the brightness change step size for each adjustment, we can ensure that each step in the color adjustment process is smooth and controllable. This helps avoid color mutations, improves the user's visual experience, and makes color transitions more natural and smooth.
[0056] S42: In the color adjustment direction, the RGB value of the foreground is adjusted successively according to the number of color adjustments and the step size of each adjustment until the RGB value of the target color is reached, wherein the RGB value adjustment formula of the foreground is: in, , and are the RGB values of the target color, is the brightness change step size, The brightness of the foreground RGB color value.
[0057] In this embodiment, after determining the brightness change step size for each adjustment, the RGB value of the foreground color needs to be adjusted one by one according to the color adjustment direction until the target color is reached. This process requires precise control of the RGB value change for each adjustment to ensure that the final color meets the preset standard value.
[0058] By adjusting the RGB values of the foreground color one by one, a smooth transition from the current color to the target color can be achieved. This method not only ensures the accuracy of color adjustment, but also improves the visual effect of the user interface, making color changes more natural and smooth. Ultimately, all elements that need to be adjusted can meet the preset contrast standards, improving the overall quality of the user interface and user experience.
[0059] Embodiment 2 The present invention also provides a dynamic adjustment system of an adaptive user interface, which is used to execute the dynamic adjustment method of an adaptive user interface. Figure 2 As shown, the dynamic adjustment system includes: The color value extraction module 100 is used to extract the RGB color values of the foreground and background of each element on the user interface, and convert the RGB color values of the foreground and background into corresponding HSV color values respectively.
[0060] The contrast evaluation module 200 is used to calculate the contrast ratio of the corresponding element based on the RGB color value and the HSV color value, and determine whether the contrast ratio of the element meets a preset standard value.
[0061] The adjustment strategy formulation module 300 is used to formulate a color adjustment strategy based on the contrast ratio of the corresponding element when the contrast ratio of the element does not meet the preset standard value, wherein the color adjustment strategy includes a color adjustment direction, a number of color adjustment times and a target color.
[0062] The color adjustment module 400 is used to gradually adjust the RGB color value of the corresponding element in the color adjustment direction according to the color adjustment times until the RGB color value gradually transitions to the target color.
[0063] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems) and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0064] A person skilled in the art may understand that all or part of the steps in the various methods of the above embodiments may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, the storage medium including a read-only memory (ROM), a random access memory (RAM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), a one-time programmable read-only memory (OTPROM), an electronically-erasable programmable read-only memory (EEPROM), a compact disc (CD-ROM) or other optical disc storage, magnetic disk storage, magnetic tape storage, or any other computer-readable medium that can be used to carry or store data.
[0065] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
Claims
1. A method for dynamically adjusting an adaptive user interface, characterized in that: The dynamic adjustment method comprises the following steps: Extract the RGB color values of the foreground and background of each element from the user interface, and convert the RGB color values of the foreground and background into corresponding HSV color values respectively; Calculating the contrast ratio of the corresponding element based on the RGB color value and the HSV color value, and determining whether the contrast ratio of the element meets a preset standard value; When the contrast ratio of the element does not meet the preset standard value, a color adjustment strategy is formulated based on the contrast ratio of the corresponding element, wherein the color adjustment strategy includes a color adjustment direction, a color adjustment number, and a target color; In the color adjustment direction, the RGB color value of the corresponding element is progressively adjusted according to the color adjustment times until the RGB color value gradually transitions to the target color.
2. The method for dynamically adjusting an adaptive user interface according to claim 1, characterized in that: The RGB color value is converted to the HSV color value using the following formula: ; ; The calculation of depends on the location of the maximum value, specifically: like ,but ; like ,but ; like ,but ; in, is the red component in the RGB color value, is the green component in the RGB color value, is the blue component in the RGB color value, is the hue in the HSV color value, is the brightness in the HSV color value, is the saturation in the HSV color value, For color difference.
3. The method for dynamically adjusting an adaptive user interface according to claim 2, characterized in that: The calculating the contrast ratio of the corresponding element based on the RGB color value and the HSV color value, and judging whether the contrast ratio of the element meets a preset standard value, includes: The RGB contrast ratio is calculated based on the foreground and background in the RGB color value, and the calculation formula is: in, is the brightness of the foreground RGB color value, is the brightness of the background's RGB color value, is the RGB contrast ratio; The HSV contrast ratio is calculated based on the foreground and background in the HSV color value, and the calculation formula is: in, is the brightness of the foreground HSV color value, is the brightness of the background in HSV color value, is the HSV contrast ratio; The contrast ratio of the element is obtained by weighted calculation based on the RGB contrast ratio and the HSV contrast ratio , and its calculation formula is: in, and The preset weights for the RGB contrast ratio and the HSV contrast ratio respectively; It is determined whether the contrast ratio of the element obtained by weighted calculation is lower than a preset standard value. If it is lower than the preset standard value, the element is marked as an object that needs to be adjusted.
4. The method for dynamically adjusting an adaptive user interface according to claim 3, characterized in that: When the contrast ratio of the element does not meet the preset standard value, formulating a color adjustment strategy based on the contrast ratio of the corresponding element includes: Determining the direction to be adjusted according to the contrast ratio of the element to obtain a color adjustment direction, wherein the color adjustment direction includes increase and decrease; Calculating a color change amplitude based on the RGB color value and the HSV color value, and determining a color adjustment number based on the color change amplitude, wherein the color change amplitude includes an RGB color change distance and an HSV color change distance; The RGB value of the target color is calculated according to the target brightness value, wherein the target brightness value is determined based on a preset standard value.
5. The method for dynamically adjusting an adaptive user interface according to claim 4, characterized in that: The calculating the color change amplitude based on the RGB color value and the HSV color value, and determining the number of color adjustments based on the color change amplitude, includes: For the RGB color change distance, the calculation formula is: in, and are the red components of the foreground and background, respectively. and are the green components of the foreground and background, respectively. and are the blue components of foreground and background respectively; The calculation formula for the HSV color change distance is: in, and are the hues of the foreground and background, and are the saturation of foreground and background, respectively. and are the brightness of foreground and background, respectively; For the color change range , and its calculation formula is: The color adjustment times are determined according to a preset segmented adjustment function, wherein the segmented adjustment function is: in, and are preset thresholds. , , and It is the preset parameter.
6. The method for dynamically adjusting an adaptive user interface according to claim 5, characterized in that: The step of calculating the RGB value of the target color according to the target brightness value, wherein the target brightness value is determined based on a preset standard value, includes: Determine a target brightness value based on a preset standard value; Calculate the brightness adjustment ratio based on the target brightness value , and its calculation formula is: in, is the target brightness value; The RGB value of the target color is calculated according to the brightness adjustment ratio, and the calculation formula is: 。 7. The method for dynamically adjusting an adaptive user interface according to claim 6, characterized in that: The step of progressively adjusting the RGB color value of the corresponding element according to the number of color adjustments in the color adjustment direction until the RGB color value gradually transitions to the target color includes: Calculate the brightness change step size for each adjustment according to the color adjustment times and the target brightness value; In the color adjustment direction, the RGB value of the foreground is adjusted successively according to the color adjustment times and the step size of each adjustment until the RGB value of the target color is reached, wherein the RGB value adjustment formula of the foreground is: in, , and are the RGB values of the target color, is the brightness change step size, The brightness of the foreground RGB color value.
8. A dynamic adjustment system for an adaptive user interface, used to execute a dynamic adjustment method for an adaptive user interface as claimed in any one of claims 1 to 7, characterized in that: The dynamic adjustment system comprises: A color value extraction module is used to extract the RGB color values of the foreground and background of each element from the user interface, and convert the RGB color values of the foreground and background into corresponding HSV color values respectively; A contrast evaluation module, used to calculate the contrast ratio of the corresponding element based on the RGB color value and the HSV color value, and determine whether the contrast ratio of the element meets a preset standard value; An adjustment strategy formulation module, used for formulating a color adjustment strategy based on the contrast ratio of the corresponding element when the contrast ratio of the element does not meet the preset standard value, wherein the color adjustment strategy includes a color adjustment direction, a color adjustment number and a target color; The color adjustment module is used to progressively adjust the RGB color value of the corresponding element in the color adjustment direction according to the color adjustment times until the RGB color value gradually transitions to the target color.
Citation Information
Patent Citations
Method and device for adjusting object color, electronic equipment and computer storage medium
CN113157356A
Image processing method and device, electronic equipment and storage medium
CN115496668A
Three-dimensional digital factory display picture rendering method based on HSV model
CN115937386A
Ultrasonic imaging apparatus and control method for the same
KR102749835B1
Dynamic color adjustment of electronic content
US10319116B1