Interface processing method and device, electronic equipment, storage medium and product
Patent Information
- Application Number
- CN202510443184.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-09
- Publication Date
- 2026-10-16
AI Technical Summary
但是,直接采用从图片中提取的颜色对应用界面的颜色进行调整,调整效果并不理想
[0031]In this disclosure, the electronic device incorporates multiple color adjustment strategies. Based on this, the electronic device can adjust the base color information using different color adjustment strategies to obtain multiple target color information values adjusted by different strategies. Therefore, the electronic device can use different target color information values from these multiple target color information values to adjust the colors of different interface elements on the same target interface. The electronic device can also use different target color information values from these multiple target color information values to adjust the colors of interface elements on different target interfaces, thus enabling personalized processing of the application interface.
Smart Images

Figure CN122924643A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of electronic technology, and in particular to an interface processing method, apparatus, electronic device, storage medium, and product. Background Technology
[0002] Intelligent color extraction and dynamic color matching technologies can extract colors from existing images and adjust the colors of the application interface accordingly, increasing the convenience of interface design. However, directly using colors extracted from images to adjust the colors of the application interface does not yield ideal results. Summary of the Invention
[0003] To overcome the problems existing in related technologies, this disclosure provides an interface processing method, apparatus, electronic device storage medium and product, which can realize personalized processing of application interfaces.
[0004] According to a first aspect of the present disclosure, an interface processing method is provided, the method comprising: in response to receiving a first image, extracting reference color information from the first image; determining at least one target color information corresponding to each color adjustment strategy based on the reference color information and multiple color adjustment strategies; and adjusting the color of at least one interface element on a target interface based on the multiple target color information obtained according to the multiple color adjustment strategies.
[0005] In some embodiments, adjusting the color of at least one interface element on a target interface based on multiple target color information obtained according to multiple color adjustment strategies includes: adjusting the color of the target interface element using the first target color information in response to detecting an association operation between a first target color information among the multiple target color information and a target interface element on the target interface.
[0006] In some embodiments, color information includes color intensity values; determining at least one target color information corresponding to each color adjustment strategy based on reference color information and multiple color adjustment strategies includes: adjusting the reference color intensity values included in the reference color information according to each color adjustment strategy to obtain at least one target color information corresponding to each color adjustment strategy.
[0007] In some embodiments, the color information further includes a hue value; the color adjustment strategy includes a hue-based color adjustment strategy; adjusting the reference color intensity value included in the reference color information according to each color adjustment strategy to obtain at least one target color information corresponding to each color adjustment strategy includes: determining a range of color intensity values corresponding to the reference hue value included in the reference color information; determining whether the reference color intensity value is within the range of color intensity values; and adjusting the reference color intensity value to the range of color intensity values in response to the reference color intensity value being outside the range of color intensity values to obtain at least one target color information.
[0008] In some embodiments, adjusting the reference color intensity value to the range of color intensity values in response to the reference color intensity value being outside the range of color intensity values includes: adjusting the reference color intensity value to the maximum color intensity value in response to the reference color intensity value being greater than the maximum color intensity value in the range of color intensity values; and adjusting the reference color intensity value to the minimum color intensity value in response to the reference color intensity value being less than the minimum color intensity value in the range of color intensity values.
[0009] In some embodiments, determining the range of color intensity values corresponding to the reference hue values included in the reference color information includes: determining whether there exists a target reference color group among a plurality of reference color groups whose hue values are the same as the reference hue values; wherein each reference color group includes an upper limit value of color intensity, a lower limit value of color intensity, and at least one hue value; in response to the existence of a target reference color group among the plurality of reference color groups, determining the range composed of the lower limit value of color intensity included in the target reference color group and the upper limit value of color intensity included in the target reference color group as the range of color intensity values.
[0010] In some embodiments, determining the range of color intensity values corresponding to the reference hue values included in the reference color information further includes: in response to the absence of a target reference color group among the plurality of reference color groups, determining adjacent first reference color groups and second reference color groups from the plurality of reference color groups; wherein the reference hue value is located between the hue values included in the first reference color group and the hue values included in the second reference color group; determining a maximum color intensity value based on the reference hue value, the upper limit value of color intensity and the hue value included in the first reference color group, and the upper limit value of color intensity and the hue value included in the second reference color group; determining a minimum color intensity value based on the reference hue value, the lower limit value of color intensity and the hue value included in the first reference color group, and the lower limit value of color intensity and the hue value included in the second reference color group; and determining a range of color intensity values based on the minimum color intensity value and the maximum color intensity value.
[0011] In some embodiments, the color intensity value includes a lightness value, and the color adjustment strategy includes a lightness-based color adjustment strategy; adjusting the reference color intensity value included in the reference color information according to each color adjustment strategy to obtain at least one target color information corresponding to each color adjustment strategy includes: adjusting the reference lightness value included in the reference color information to each lightness value range in at least one lightness value range to obtain the target color information corresponding to each lightness value range.
[0012] In some embodiments, the color intensity value further includes a chroma value, and the color adjustment strategy includes a chroma-based color adjustment strategy; adjusting the reference lightness value included in the reference color information to each lightness value range in at least one lightness value range to obtain target color information corresponding to each lightness value range, further comprising: adjusting the reference lightness value included in the reference color information to each lightness value range to obtain first color information corresponding to each lightness value range; obtaining the chroma value included in the first color information; adjusting the chroma value included in the first color information to the chroma threshold in response to the chroma value included in the first color information being greater than the chroma threshold in order to obtain target color information corresponding to each lightness value range; and determining the first color information corresponding to each lightness value range as target color information corresponding to each lightness value range in response to the chroma value included in the first color information being less than or equal to the chroma threshold in order to obtain target color information corresponding to each lightness value range.
[0013] In some embodiments, the method further includes: determining character color information corresponding to target color information in each brightness value range; wherein the target color information in each brightness value range is used to adjust the color of at least one interface element in the target interface, and the character color information is used to adjust the color of characters in at least one interface element.
[0014] In some embodiments, the first image is an image on the target interface.
[0015] According to a second aspect of the present disclosure, an interface processing apparatus is provided, the apparatus comprising: an extraction module configured to extract reference color information from a first image in response to receiving a first image; a first determination module configured to determine at least one target color information corresponding to each color adjustment strategy based on the reference color information and multiple color adjustment strategies; and an adjustment module configured to adjust the color of at least one interface element on a target interface based on the multiple target color information obtained according to the multiple color adjustment strategies.
[0016] In some embodiments, the adjustment module is configured to: in response to detecting an association operation between a first target color information among a plurality of target color information and a target interface element on a target interface, adjust the color of the target interface element using the first target color information.
[0017] In some embodiments, the color information includes a color intensity value; the first determining module is configured to: adjust the reference color intensity value included in the reference color information according to each color adjustment strategy to obtain at least one target color information corresponding to each color adjustment strategy.
[0018] In some embodiments, the color information further includes a hue value; the color adjustment strategy includes a hue-based color adjustment strategy; the first determining module is configured to: determine the range of color intensity values corresponding to the reference hue value included in the reference color information; determine whether the reference color intensity value is within the range of color intensity values; and adjust the reference color intensity value to the range of color intensity values in response to the reference color intensity value being outside the range of color intensity values, thereby obtaining at least one target color information.
[0019] In some embodiments, the first determining module is configured to: adjust the reference color intensity value to the maximum color intensity value in response to the reference color intensity value being greater than the maximum color intensity value in the color intensity value range; and adjust the reference color intensity value to the minimum color intensity value in response to the reference color intensity value being less than the minimum color intensity value in the color intensity value range.
[0020] In some embodiments, the first determining module is configured to: determine whether there exists a target reference color group among a plurality of reference color groups whose hue value is the same as the reference hue value; wherein each reference color group includes an upper limit value of color intensity, a lower limit value of color intensity, and at least one hue value; in response to the existence of a target reference color group among the plurality of reference color groups, determine the range composed of the lower limit value of color intensity included in the target reference color group and the upper limit value of color intensity included in the target reference color group as the color intensity value range.
[0021] In some embodiments, the first determining module is further configured to: in response to the absence of a target reference color group among the plurality of reference color groups, determine adjacent first reference color groups and second reference color groups from the plurality of reference color groups; wherein, a reference hue value is located between the hue values included in the first reference color group and the hue values included in the second reference color group; determine a maximum color intensity value based on the reference hue value, the upper limit value of color intensity and the hue value included in the first reference color group, and the upper limit value of color intensity and the hue value included in the second reference color group; determine a minimum color intensity value based on the reference hue value, the lower limit value of color intensity and the hue value included in the first reference color group, and the lower limit value of color intensity and the hue value included in the second reference color group; and determine a color intensity value range based on the minimum color intensity value and the maximum color intensity value.
[0022] In some embodiments, the color intensity value includes a lightness value, and the color adjustment strategy includes a lightness-based color adjustment strategy; the first determining module is configured to: adjust the reference lightness value included in the reference color information to each lightness value range in at least one lightness value range, so as to obtain the target color information corresponding to each lightness value range.
[0023] In some embodiments, the color intensity value further includes a chroma value, and the color adjustment strategy includes a chroma-based color adjustment strategy; the first determining module is configured to: adjust the reference lightness value included in the reference color information to each lightness value range to obtain first color information corresponding to each lightness value range; obtain the chroma value included in the first color information; in response to the chroma value included in the first color information being greater than a chroma threshold, adjust the chroma value included in the first color information to the chroma threshold to obtain target color information corresponding to each lightness value range; in response to the chroma value included in the first color information being less than or equal to the chroma threshold, determine the first color information corresponding to each lightness value range as target color information corresponding to each lightness value range.
[0024] In some embodiments, the apparatus further includes: a second determining module configured to determine character color information corresponding to target color information in each brightness value range; wherein the target color information in each brightness value range is used to adjust the color of at least one interface element in the target interface, and the character color information is used to adjust the color of a character in at least one interface element.
[0025] In some embodiments, the first image is an image on the target interface.
[0026] According to a third aspect of the present disclosure, an electronic device is provided, comprising:
[0027] A processor; a memory for storing computer programs or instructions; wherein the processor executes the computer programs or instructions to implement the steps of the method described in the first aspect above.
[0028] According to a fourth aspect of the present disclosure, a non-transitory computer-readable storage medium is provided, which stores executable instructions or a computer program that, when executed by a processor, implements the steps of the method described in the first aspect.
[0029] According to a fifth aspect of the present disclosure, a computer program product is provided, including a computer program or instructions, which, when executed by a processor, implement the steps of the method described in the first aspect above.
[0030] The technical solutions provided by the embodiments of this disclosure may include the following beneficial effects:
[0031] In this disclosure, the electronic device incorporates multiple color adjustment strategies. Based on this, the electronic device can adjust the base color information using different color adjustment strategies to obtain multiple target color information values adjusted by different strategies. Therefore, the electronic device can use different target color information values from these multiple target color information values to adjust the colors of different interface elements on the same target interface. The electronic device can also use different target color information values from these multiple target color information values to adjust the colors of interface elements on different target interfaces, thus enabling personalized processing of the application interface.
[0032] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description
[0033] The accompanying drawings, which are incorporated in and form a part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure.
[0034] Figure 1 This is a flowchart illustrating a first interface processing method according to an exemplary embodiment.
[0035] Figure 2 This is a schematic diagram illustrating a first mapping relationship according to an exemplary embodiment.
[0036] Figure 3 This is a schematic diagram illustrating a second mapping relationship according to an exemplary embodiment.
[0037] Figure 4 This is a flowchart illustrating a second interface processing method according to an exemplary embodiment.
[0038] Figure 5 This is a flowchart illustrating a third interface processing method according to an exemplary embodiment.
[0039] Figure 6 This is a schematic diagram illustrating a reference color group in the ARGB color space according to an exemplary embodiment.
[0040] Figure 7 This is a schematic diagram illustrating a reference color group in an HCT color space according to an exemplary embodiment.
[0041] Figure 8 This is a schematic diagram of a reference color group in an HCT color space according to another exemplary embodiment.
[0042] Figure 9 This is a flowchart illustrating a first method for adjusting reference color information according to an exemplary embodiment.
[0043] Figure 10 This is a flowchart illustrating a second method for adjusting reference color information according to an exemplary embodiment.
[0044] Figure 11 This is a flowchart illustrating a fourth interface processing method according to an exemplary embodiment.
[0045] Figure 12 This is a flowchart illustrating a fifth interface processing method according to an exemplary embodiment.
[0046] Figure 13 This is a flowchart illustrating a third method for adjusting reference color information according to an exemplary embodiment.
[0047] Figure 14 This is a flowchart illustrating a sixth interface processing method according to an exemplary embodiment.
[0048] Figure 15 This is a block diagram illustrating an interface processing apparatus according to an exemplary embodiment.
[0049] Figure 16 This is a structural block diagram of an electronic device according to an exemplary embodiment. Detailed Implementation
[0050] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this disclosure. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this disclosure as detailed in the appended claims.
[0051] Before introducing the embodiments of this disclosure, the application scenarios of these embodiments will be described first, as follows:
[0052] Intelligent color extraction and dynamic color matching technologies can extract colors from existing images and adjust the colors of the application interface accordingly, thereby improving the ease of interface design. However, directly using colors extracted from images to adjust the colors of the application interface does not yield ideal results.
[0053] For example, electronic devices can use Material-Color-Utilities (MCU) to extract colors from existing images for the application interface and adjust the colors of interface elements based on the extracted colors. However, the color style generated by Material-Color-Utilities is fixed and always reflects the native style of the operating system, making it difficult to adapt to the visual styles and design languages of different brands.
[0054] To address the aforementioned problems, this disclosure provides an interface processing method. Figure 1 This is a flowchart illustrating a first interface processing method according to an exemplary embodiment. The interface processing method provided in this disclosure is executed by an electronic device, which may include a mobile terminal and a fixed terminal. The mobile terminal may include smartphones, tablet computers, laptops, etc. The fixed terminal may include desktop computers, all-in-one computers, etc.
[0055] In the following text, electronic devices will be used as the execution subject, and references will be made. Figure 1 The steps shown illustrate the interface processing method provided in this disclosure. This interface processing method mainly includes the following steps:
[0056] In step 101, in response to receiving the first image, reference color information is extracted from the first image.
[0057] Understandably, if a user needs to extract color information from a first image, the first image can be input into the electronic device. Based on this, the electronic device can receive the first image. Then, the electronic device can extract the color information contained in the first image and use at least one of the extracted color information as reference color information.
[0058] In some embodiments, the first image includes, but is not limited to: an image acquired by an image acquisition device, a user-drawn image, an image generated by a neural network model, etc.
[0059] In some embodiments, the reference color information may be the color information of the representative color in the first image.
[0060] For example, an electronic device can extract color information from a first image through the Palette Application Programming Interface (Palette API).
[0061] In some embodiments, when there are multiple color information extracted by the Palette API, the electronic device can obtain the number of pixels of each color information in the first image and use the color information with the most pixels as the reference color information.
[0062] In some embodiments, the reference color information can be color information in any color space, and this disclosure does not limit this.
[0063] For example, the reference color information may include, but is not limited to: color information in the HCT color space, color information in the RGB color space, color information in the ARGB color space, and color information in the XYZ color space. In the HCT color space, H stands for Hue, C for Chroma, and T for Tone. In the RGB color space, R stands for Red, G for Green, and B for Blue. In the ARGB color space, A stands for Alpha. In the XYZ color space, X represents the red primary color component, Y represents the green primary color component, and Z represents the blue primary color component.
[0064] In step 102, based on the reference color information and multiple color adjustment strategies, at least one target color information corresponding to each color adjustment strategy is determined.
[0065] Understandably, after obtaining the reference color information through step 101, the electronic device can adjust the reference color information using each of the various color adjustment strategies to obtain at least one target color information adjusted by each strategy. Thus, the electronic device can obtain multiple target color information.
[0066] In some embodiments, the electronic device can output multiple target color information obtained.
[0067] In some embodiments, if the number of color adjustment strategies stored in the electronic device is greater than two, the electronic device can determine at least two color adjustment strategies from a plurality of color adjustment strategies and use the determined at least two color adjustment strategies as target color adjustment strategies. Then, the electronic device can adjust the reference color information based on the target color adjustment strategies to obtain at least two target color information.
[0068] In some embodiments, after obtaining at least two target color information, the electronic device may display the at least two target color information or display the color represented by each of the at least two target color information.
[0069] For example, an electronic device can display the color represented by each target color information in the form of color blocks.
[0070] In some embodiments, multiple color adjustment strategies can be integrated into a Software Development Kit (SDK). Based on this, after obtaining the reference color information, the electronic device can call the SDK through a preset interface to adjust the reference color information using the various color adjustment strategies within the SDK.
[0071] In some embodiments, the electronic device may also store at least one preset color information and at least one alternative color information. The preset color information is color information that the user does not need, and the alternative color information is different from the preset color information. Based on this, after obtaining the reference color information, the electronic device can also determine whether the reference color information is the same as the preset color information. If the reference color information is the same as any of the preset color information, the electronic device can determine one of the alternative color information from at least one alternative color information as the reference color information. If the reference color information is different from all the preset color information, the electronic device can further adjust the reference color information based on multiple color adjustment strategies to obtain the target color information.
[0072] In step 103, the color of at least one interface element on the target interface is adjusted based on multiple target color information obtained according to multiple color adjustment strategies.
[0073] Understandably, after obtaining multiple target color information through step 102, the electronic device can adjust the color of at least one interface element on the target interface based on at least one of the multiple target color information.
[0074] In some embodiments, the electronic device may adjust the color of at least one interface element on the target interface to the color indicated by the target color information.
[0075] In some embodiments, the interface elements on the target interface include, but are not limited to: the background of the target interface, controls on the target interface, and input boxes on the target interface.
[0076] In some embodiments, an electronic device may use different target color information from a variety of target color information to adjust the color of different interface elements on the target interface.
[0077] For example, an electronic device may use one target color information to adjust the color of the background on the target interface, and use another target color information to adjust the color of the controls on the target interface.
[0078] It should be noted that adjusting the color of interface elements based on target color information can be understood as adjusting the color of the interface elements to the color indicated by the target color information.
[0079] In some embodiments, if the target color information is color information in the HCT color space, the electronic device may first encode the target color information using a hexadecimal color code (HEX) format, and then use the encoded target color information to adjust the color of the interface elements on the target interface.
[0080] In this embodiment, the electronic device employs multiple color adjustment strategies. Based on this, the electronic device can adjust the base color information using different color adjustment strategies to obtain multiple target color information adjusted by different strategies. Therefore, the electronic device can use different target color information from these multiple target color information to adjust the colors of different interface elements on the same target interface. The electronic device can also use different target color information from these multiple target color information to adjust the colors of interface elements on different target interfaces, thus enabling personalized processing of the application interface.
[0081] In some embodiments, step 103 includes: in response to detecting an association operation between a first target color information among a plurality of target color information and a target interface element on a target interface, adjusting the color of the target interface element using the first target color information.
[0082] Understandably, after outputting multiple target color information, the electronic device can also detect user actions that associate at least some of the target color information with interface elements on the target interface. If the electronic device detects a user action that associates a first target color information with a target interface element on the target interface, it can use the first target color information to adjust the color of the target interface element.
[0083] In some embodiments, the first target color information can be any target color information among a plurality of target color information, and this disclosure does not limit this.
[0084] In some embodiments, the target interface element can be any interface element in the target interface, and this disclosure does not limit this.
[0085] In this embodiment of the disclosure, the user can choose to associate different target color information with different interface elements, so as to adjust the color of different interface elements on the target interface using different target color information, which can improve the color adjustment efficiency of the interface.
[0086] In some embodiments, the color information includes color intensity values. Step 102 includes adjusting the reference color intensity values included in the reference color information according to each color adjustment strategy to obtain at least one target color information corresponding to each color adjustment strategy.
[0087] Understandably, after obtaining the reference color information through step 101, the electronic device can adjust the color intensity value of the reference color information using each of the various color adjustment strategies to obtain at least one target color information adjusted by each color adjustment strategy. In this way, the electronic device can obtain multiple target color information.
[0088] In some embodiments, the color information also includes a hue value. The hue value of the target color information is the same as the hue value of the reference color information, but the color intensity value of the target color information is different from the color intensity value of the reference color information.
[0089] In some embodiments, color intensity values include, but are not limited to, chroma values and / or lightness values.
[0090] In some embodiments, the color information further includes a hue value. The color adjustment strategy includes a hue-based color adjustment strategy. Adjusting the reference color intensity value included in the reference color information according to each color adjustment strategy to obtain at least one target color information corresponding to each color adjustment strategy includes: determining the range of color intensity values corresponding to the reference hue value included in the reference color information; determining whether the reference color intensity value is within the color intensity value range; and adjusting the reference color intensity value to the range of color intensity values in response to the reference color intensity value being outside the color intensity value range, thereby obtaining at least one target color information.
[0091] Understandably, after obtaining the reference color information, the electronic device can determine the range of color intensity values corresponding to the hue values included in the reference color information. Then, the electronic device can determine whether the reference color intensity values in the reference color information are within the range of color intensity values. If the reference color intensity values are within the range, no adjustment is made to the reference color intensity values included in the reference color information. If the reference color intensity values included in the reference color information are outside the range of color intensity values, then the color intensity values included in the reference color information can be adjusted to be within the range of color intensity values.
[0092] In some embodiments, when the color intensity value is a chroma value, the range of color intensity values includes the range of chroma values. Based on this, after obtaining the reference color information, the electronic device can determine the range of chroma values corresponding to the reference hue values in the reference color information. Then, the electronic device can determine whether the reference chroma values included in the reference color information are within the chroma value range. If the reference chroma value is within the chroma value range, the electronic device does not adjust the reference chroma value. If the reference chroma value is outside the chroma value range, the electronic device can adjust the reference chroma value to be within the chroma value range.
[0093] In some embodiments, the electronic device may store a first mapping relationship, wherein the first mapping relationship is a mapping relationship between hue values and chroma value ranges. Based on this, after obtaining a reference hue value, the electronic device can look up the chroma value range corresponding to the reference hue value from the first mapping relationship.
[0094] For example, Figure 2 This is a schematic diagram illustrating a first mapping relationship according to an exemplary embodiment. Figure 2 The horizontal axis in the graph represents the hue value. Figure 2 The vertical axis represents the range of chroma values corresponding to the hue values. For example... Figure 2 As shown, the chroma value range corresponding to a hue value of 28 is 82 ( Figure 2 The chroma value of point A1 in the image is up to the chroma value of 96. Figure 2 The chroma value of point B1); the chroma value range corresponding to hue value 286 is chroma value 49 ( Figure 2 The chroma value of point A2) to the chroma value 67 ( Figure 2 (The chroma value of point B2).
[0095] In some embodiments, when the color intensity value is a lightness value, the color intensity value range includes the lightness value range. Based on this, the electronic device can also determine whether the reference lightness value included in the reference color information is within the lightness value range. If the reference lightness value is within the lightness value range, the electronic device may not adjust the reference lightness value. If the reference lightness value is outside the lightness value range, the electronic device may adjust the reference lightness value to be within the lightness value range to obtain the target color information.
[0096] In some embodiments, the electronic device may store a second mapping relationship, wherein the second mapping relationship is a mapping relationship between hue values and lightness value ranges. Based on this, after obtaining a reference lightness value, the electronic device can look up the lightness value range corresponding to the reference lightness value from the second mapping relationship.
[0097] For example, Figure 3 This is a schematic diagram illustrating a second mapping relationship according to an exemplary embodiment. Figure 3 The horizontal axis in the graph represents the hue value. Figure 3 The vertical axis represents the range of lightness values corresponding to the hue values. For example... Figure 3 As shown, the range of lightness values corresponding to a hue value of 28 is 48 ( Figure 3 The lightness value of point C1) to the lightness value 60 ( Figure 3 The lightness value of point D1); the lightness value range corresponding to a hue value of 286 is a lightness value of 50 ( Figure 3 The lightness value of point C2) to the lightness value 70 ( Figure 3 (The brightness value of point D2).
[0098] In some embodiments, the electronic device may determine a first mapping relationship and a second mapping relationship based on the color information of the colors included in a plurality of reference color groups.
[0099] For example, the colors included in the reference color group can be the colors included in a brand color gamut.
[0100] In some embodiments, a brand color gamut can be understood as the range of colors used by a brand. For example, a cosmetics brand's brand color gamut includes red; a beverage brand's brand color gamut includes green, white, and brown.
[0101] For example, suppose the target interface is a display interface for a beverage brand. If the beverage brand's color gamut includes green, white, and brown, the electronic device can determine a first mapping relationship and a second mapping relationship based on the color information of green, white, and brown. Since the first and second mapping relationships are determined based on the color information of green, white, and brown, if the electronic device adjusts the reference chroma and reference lightness values based on the first and second mapping relationships, it can adjust the reference lightness and reference chroma values to fall within the color range of green, white, and brown. This ensures that the colors of the interface elements on the target interface also fall within the color range of green, white, and brown, improving the consistency between the colors of the target interface and the colors included in the beverage brand's color gamut.
[0102] It should be noted that the chroma value range mentioned in the above embodiments includes chroma values at both endpoints. Similarly, the lightness value range mentioned in the above embodiments includes lightness values at both endpoints.
[0103] In some embodiments, the colors included in the plurality of reference color groups may be input by the user when inputting the first image, or may be pre-stored in the electronic device; this disclosure does not limit this.
[0104] For example, a user can place a first image and multiple reference color groups in the same folder and import them into an electronic device. Based on this, the electronic device can retrieve the first image and multiple reference color groups from the same folder.
[0105] In this embodiment, the electronic device uses a first mapping relationship determined based on the color information within a brand color gamut to indicate the range of chroma values for the color information within that brand color gamut, and a second mapping relationship determined based on the color information within the brand color gamut to indicate the range of lightness values for the color within that brand color gamut. Therefore, by adjusting the reference chroma and lightness values based on the first and second mapping relationships corresponding to a brand color gamut, the electronic device can ensure that the lightness values in the obtained target color information remain within the lightness value range of the brand color gamut, and that the chroma values in the obtained target color information remain within the chroma value range of the brand color gamut, thereby improving the consistency between the adjusted interface element colors and the brand color scheme.
[0106] In some embodiments, adjusting the reference color intensity value to the range of color intensity values in response to the reference color intensity value being outside the range of color intensity values includes: adjusting the reference color intensity value to the maximum color intensity value in response to the reference color intensity value being greater than the maximum color intensity value in the range of color intensity values; and adjusting the reference color intensity value to the minimum color intensity value in response to the reference color intensity value being less than the minimum color intensity value in the range of color intensity values.
[0107] Understandably, if the reference color intensity value in the reference color information is outside the color intensity value range, the electronic device can compare the reference color intensity value with the maximum color intensity value included in the color intensity value range. If the reference color intensity value is greater than the maximum color intensity value included in the color intensity value range, the electronic device can adjust the reference color intensity value to the maximum color intensity value to obtain the target color information. If the reference color intensity value is less than the maximum color intensity value, the electronic device can further confirm whether the reference color intensity value is less than the minimum color intensity value included in the color intensity value range. If the reference color intensity value is less than the minimum color intensity value included in the color intensity value range, the electronic device can adjust the reference color intensity value included in the reference color information to the minimum color intensity value included in the color intensity value range to obtain the target color information. If the reference color intensity value is equal to the maximum or minimum color intensity value included in the color intensity value range, then the reference color information is used as the target color information.
[0108] In some embodiments, when the reference color intensity value is a reference chroma value, if the reference chroma value is greater than the maximum chroma value included in the chroma value range, the electronic device can adjust the reference chroma value to the maximum chroma value. If the reference chroma value is less than the minimum chroma value included in the chroma value range, the electronic device can adjust the reference chroma value to the minimum chroma value.
[0109] In some embodiments, when the reference color intensity value is a reference lightness value, if the reference lightness value is greater than the maximum lightness value included in the lightness value range, the electronic device can adjust the reference lightness value included in the reference color information to the maximum lightness value. If the reference lightness value is less than the minimum lightness value included in the lightness value range, the electronic device can adjust the lightness value included in the reference color information to the minimum lightness value.
[0110] For example, Figure 4 This is a flowchart illustrating a second interface processing method according to an exemplary embodiment. In the following text, the method will be described using the adjustment of the target interface (…). Figure 4 Interface elements on interface 4a) Figure 4 Taking the colors of text 41a and control 42a as an example, the interface processing method provided in the above embodiment will be further described. The method includes:
[0111] In step 401, the electronic device can extract the reference color information in the ARGB color space from the first image 43a on the interface 4a via the Palette API (see reference). Figure 4 (ARGB: 0xFF2F7EBF).
[0112] In step 402, the electronic device converts the reference color information in the ARGB color space to the reference color information in the HCT color space (reference). Figure 4 HCT in the data: 251, 48, 51).
[0113] In step 403, the electronic device obtains the chroma value range (50.51 to 65.95) and lightness value range (55.90 to 71.70) corresponding to the reference hue value 251 from the configuration file.
[0114] In step 404, since the reference chroma value 48 is less than the minimum chroma value 50.51 in the chroma value range (50.51 to 65.95), the electronic device can adjust the reference chroma value 48 to the minimum chroma value 50.51; since the reference lightness value 51 is less than the minimum lightness value 55.90 in the lightness value range (55.90 to 71.70), the electronic device can adjust the reference lightness value 51 to the minimum lightness value 55.99. At this time, the electronic device can obtain the target color information (reference). Figure 4 HCT values: 251, 50.51, 55.90.
[0115] In step 405, the electronic device converts the target color information into target color information in HEX format (see reference). Figure 4 Color information: #3488CE).
[0116] In step 406, the electronic device adjusts the colors of the text 41a and control 42a on the interface 4a to the colors indicated by the target color information (#3488CE).
[0117] It should be noted that the target color information (#3488CE) indicates the color as blue. Figure 4 (Not shown in the image).
[0118] For example, Figure 5 This is a flowchart illustrating a third interface processing method according to an exemplary embodiment. In the following text, the method will be described using the adjustment of the target interface (…). Figure 5 Interface elements on interface 4b) (see reference) Figure 4 Taking the colors of text 41b and control 42b as an example, the interface processing method provided in the above embodiment will be further described. The method includes:
[0119] In step 501, the electronic device can extract reference color information in the ARGB color space from the first image 43b on interface 4b via the Palette API (see reference). Figure 5 (ARGB: 0xFFF6068A).
[0120] In step 502, the electronic device converts the reference color information in the ARGB color space to the reference color information in the HCT color space (reference). Figure 5 HCT values: 359, 100, 54.
[0121] In step 503, the electronic device obtains the hue value 359 corresponding to the chroma value range (81.55 to 95.61) and the lightness value range (49.01 to 60.14) from the reference color information in the configuration file.
[0122] In step 504, since the reference chroma value 100 is greater than the maximum chroma value 95.61 in the chroma value range (81.55 to 95.61), the electronic device adjusts the reference chroma value 100 to the maximum chroma value 95.61. Since the reference lightness value 54 is within the lightness value range (49.01 to 60.14), no adjustment to the reference lightness value is required. Based on this, the electronic device can obtain the target color information (reference). Figure 5 HCT values: 359, 95.61, 54.
[0123] In step 505, the electronic device converts the target color information into target color information in HEX format (see reference). Figure 5 Color information: #F21E8A).
[0124] In step 506, the electronic device adjusts the colors of the text 41b and control 42b on the interface 4b to the colors indicated by the target color information (#F21E8A).
[0125] It should be noted that the target color information (#F21E8A) indicates a bright pink color. Figure 5 (Not shown in the image).
[0126] In some embodiments, determining the range of color intensity values corresponding to the reference hue values included in the reference color information includes: determining whether there exists a target reference color group among a plurality of reference color groups whose hue values are the same as the reference hue values; wherein each reference color group includes an upper limit value of color intensity, a lower limit value of color intensity, and at least one hue value; in response to the existence of a target reference color group among the plurality of reference color groups, determining the range composed of the lower limit value of color intensity included in the target reference color group and the upper limit value of color intensity included in the target reference color group as the range of color intensity values.
[0127] Understandably, electronic devices can acquire reference color information from multiple reference color groups. Each reference color group includes at least one hue value, an upper limit value for color intensity, and a lower limit value for color intensity. Based on this, the electronic device can determine whether there exists a reference color group among the multiple reference color groups whose hue value is the same as the reference hue value. If so, the electronic device can use the reference color group whose hue value is the same as the reference hue value as the target reference color group. After obtaining the target reference color group, the electronic device can determine the range of color intensity values corresponding to the reference hue value as the range of color intensity values formed by the lower limit value and the upper limit value of color intensity included in the target reference color group.
[0128] In some embodiments, the difference between the hue values of two adjacent reference color groups in a plurality of reference color groups is greater than or equal to a first hue threshold.
[0129] In some embodiments, each reference color group may include multiple reference color information. The hue values of the multiple reference color information included in the same reference color group may be the same or different, and the color intensity values of the multiple reference color information included in the same reference color group may be different. Based on this, each reference color group includes at least one hue value, an upper limit color intensity value, and a lower limit color intensity value.
[0130] In some embodiments, when the hue values of multiple reference color information included in the same reference color group are different, the difference between the hue values of the multiple reference color information included in the same reference color group is less than or equal to the second hue threshold.
[0131] In some embodiments, the second hue threshold is less than the first hue threshold.
[0132] In some embodiments, the upper limit of color intensity included in each reference color group may include an upper limit of chroma and an upper limit of lightness.
[0133] In some embodiments, the lower limit of color intensity for each reference color group may include a lower limit of chroma and a lower limit of lightness.
[0134] For example, Figure 6 This is a schematic diagram illustrating a reference color group in the ARGB color space according to an exemplary embodiment. Figure 7 This is a schematic diagram illustrating a reference color group in an HCT color space according to an exemplary embodiment; Figure 8 This is a schematic diagram of a reference color group in an HCT color space according to another exemplary embodiment.
[0135] Figure 6 The eight reference color groups shown are: reference color group H1, reference color group H2 to reference color group H8. Figure 7 It is Figure 6 The reference color information included in reference color group H1 to reference color group H8 is converted into the reference color information obtained after conversion to the HCT color space. Figure 8 Each of the reference color groups H1 to H8 includes a hue value, an upper limit chroma value, a lower limit chroma value, an upper limit lightness value, and a lower limit lightness value. Figure 8 In this context, Hend is a reference color group with a hue value of 360.
[0136] It should be noted that if multiple reference color information items included in a reference color group have different hue values, the electronic device can use the smallest hue value among the multiple hue values included in the reference color group as the hue value of the reference color group. For example, if reference color group H2 includes reference color information H2a and reference color information H2b, and the hue value of reference color information H2a is 35 and the hue value of reference color information H2b is 34, then the electronic device can use the hue value 34 as the hue value of reference color group H2.
[0137] In some embodiments, based on Figure 8The reference color group is shown in the figure. If the reference hue value is 28, the electronic device can determine that the reference color group H1 is the target reference color group. The chroma value corresponding to the reference hue value 28 is in the range of 82 to 96, and the lightness value corresponding to the reference hue value 28 is in the range of 56 to 63.
[0138] In some embodiments, determining the range of color intensity values corresponding to the reference hue values included in the reference color information further includes: in response to the absence of a target reference color group among the plurality of reference color groups, determining adjacent first reference color groups and second reference color groups from the plurality of reference color groups; wherein the reference hue value is located between the hue values included in the first reference color group and the hue values included in the second reference color group; determining a maximum color intensity value based on the reference hue value, the upper limit value of color intensity and the hue value included in the first reference color group, and the upper limit value of color intensity and the hue value included in the second reference color group; determining a minimum color intensity value based on the reference hue value, the lower limit value of color intensity and the hue value included in the first reference color group, and the lower limit value of color intensity and the hue value included in the second reference color group; and determining a range of color intensity values based on the minimum color intensity value and the maximum color intensity value.
[0139] Understandably, if none of the multiple reference color groups stored in the electronic device contains a target reference color group with a hue value identical to the reference hue value, the electronic device can determine a first reference color group with a hue value less than the reference hue value and a second reference color group with a hue value greater than the reference hue value, wherein the first and second reference color groups are adjacent. After determining the first and second reference color groups, the electronic device can obtain the first hue value and the first upper limit value of color intensity included in the first reference color group. The electronic device can also obtain the second hue value and the second upper limit value of color intensity included in the second reference color group. Then, based on the reference hue value, the first hue value, the first upper limit value of color intensity, the second hue value, and the second upper limit value of color intensity, the electronic device can determine the maximum color intensity value. The electronic device can also obtain the first lower limit value of color intensity included in the first reference color group and the second lower limit value of color intensity included in the second reference color group. Subsequently, the electronic device can determine the minimum color intensity value based on the reference hue value, the first hue value, the first lower limit of color intensity, the second hue value, and the second lower limit of color intensity. After obtaining the maximum and minimum color intensity values, the electronic device can define the range from the minimum to the maximum color intensity value as the color intensity value range corresponding to the reference hue value.
[0140] In some embodiments, when the color intensity value is a chroma value, the range of color intensity values is the range of chroma values. Based on this, the electronic device can acquire the first hue value, the first upper chroma value, and the first lower chroma value included in the first reference color group. The electronic device can also acquire the second hue value, the second upper chroma value, and the second lower chroma value included in the second reference color group. Then, the electronic device can determine the maximum chroma value based on the reference hue value, the first hue value, the first upper chroma value, the second hue value, and the second upper chroma value. Additionally, the electronic device can determine the minimum chroma value based on the reference hue value, the first hue value, the first lower chroma value, the second hue value, and the second lower chroma value. After obtaining the maximum and minimum chroma values, the electronic device can determine the range formed by the minimum and maximum chroma values as the chroma value range corresponding to the reference hue value.
[0141] In some embodiments, the electronic device may determine the maximum chroma value using the following formula (1):
[0142] M CMax =H1 CMax +(H2 CMax -H1 CMax )×[(M H -H1 H )÷(H2 H -H1 H (1);
[0143] Among them, M CMax H1 is the maximum chroma value. CMax H2 is the upper limit of the first chroma value. CMax M is the upper limit of the second chroma. H H1 is the base hue value. H H2 is the first hue value. H This is the second hue value.
[0144] In some embodiments, the electronic device may determine the minimum chroma value using the following formula (2):
[0145] M CMin =H1 CMin +(H2 CMin -H1 CMin )×[(M H -H1 H )÷(H2 H -H1 H (2);
[0146] Among them, M CMin H1 is the minimum chroma value. CMin H2 is the lower limit of the first chroma value. CMinM is the lower limit of the second chroma. H H1 is the base hue value. H H2 is the first hue value. H This is the second hue value.
[0147] In some embodiments, when the color intensity value is a lightness value, the range of color intensity values is a range of lightness values. The electronic device can acquire a first upper lightness value and a first lower lightness value included in a first reference color group, and a second upper lightness value and a second lower lightness value included in a second reference color group. Then, the electronic device can determine a maximum lightness value based on a reference hue value, a first hue value, a first upper lightness value, a second hue value, and a second upper lightness value. Additionally, the electronic device can determine a minimum lightness value based on a reference hue value, a first hue value, a first lower lightness value, a second hue value, and a second lower lightness value. After obtaining the maximum and minimum lightness values, the electronic device can define the range formed by the minimum and maximum lightness values as the lightness value range corresponding to the reference hue value.
[0148] In some embodiments, the electronic device may determine the maximum brightness value using the following formula (3):
[0149] M TMax =H1 TMax +(H2 TMax -H1 TMax )×[(M H -H1 H )÷(H2 H -H1 H (3);
[0150] Among them, M TMax H1 is the maximum brightness value. TMax H2 is the upper limit of the first brightness value. TMax M is the second upper limit of brightness. H H1 is the base hue value. H H2 is the first hue value. H This is the second hue value.
[0151] In some embodiments, the electronic device may determine the minimum brightness value using the following formula (4):
[0152] M TMin =H1 TMin +(H2 TMin -H1 TMin )×[(M H -H1 H )÷(H2 H -H1 H (4);
[0153] Among them, M TMin H1 is the minimum brightness value. TMin H2 is the first lower limit of brightness. TMin M is the second lower limit of brightness. H H1 is the base hue value. H H2 is the first hue value. H This is the second hue value.
[0154] In some embodiments, the electronic device can also calculate the maximum and minimum chroma values corresponding to one or more hue values located between two adjacent reference color groups based on formulas (1) to (4) above. Then, the electronic device can draw based on the upper and lower chroma limits of multiple reference color groups, and the calculated maximum and minimum chroma values corresponding to one or more hue values. Figure 2 The first mapping relationship is shown. The electronic device can also calculate the maximum and minimum lightness values corresponding to one or more hue values located between two adjacent reference color groups based on the above formulas (1) to (4). Then, the electronic device can draw based on the upper and lower lightness limits of multiple reference color groups, and the calculated maximum and minimum lightness values corresponding to one or more hue values. Figure 3 The second mapping relationship is shown.
[0155] For example, Figure 9 This is a flowchart illustrating a first method for adjusting reference color information according to an exemplary embodiment. In the following, reference will be made to... Figure 9 The steps shown below describe the process of adjusting the colors of interface elements on the target interface using a hue-based color adjustment strategy. Specifically:
[0156] In step 901, the electronic device can extract reference color information in the ARGB color space from the first image on the target interface using the Palette API.
[0157] In step 902, the electronic device converts the reference color information in the ARGB color space to the reference color information in the HCT color space.
[0158] In step 903, the electronic device determines whether the reference color information is the same as the preset color information. If yes, it proceeds to step 904; otherwise, it proceeds to step 905.
[0159] In step 904, the electronic device uses one of the alternative color information selected by the user as the target color information.
[0160] In step 905, the electronic device determines whether the reference hue value is the same as the hue value of any reference color group. If yes, steps 906 and 909 are executed; otherwise, step 907 is executed.
[0161] In step 906, the electronic device determines the range of color intensity values corresponding to the reference hue value as the range consisting of the lower limit and upper limit of color intensity of the target reference color group whose hue value is the same as the reference hue value.
[0162] In step 907, the electronic device determines the adjacent first reference color group and second reference color group from a plurality of reference color groups.
[0163] In step 908, the electronic device determines the range of color intensity values corresponding to the reference hue value based on the reference hue value, the reference color information included in the first reference color group, and the reference color information included in the second reference color group, through the above formula (1) value (4).
[0164] In step 909, in response to the fact that the color intensity value range includes the maximum chroma value, the electronic device determines whether the reference chroma value is greater than the maximum chroma value. If yes, step 910 is executed; otherwise, step 911 is executed.
[0165] In step 910, the electronic device adjusts the reference chroma value to the maximum chroma value.
[0166] In step 911, in response to the inclusion of a minimum chroma value in the color intensity value range, the electronic device determines whether the reference chroma value in the reference color information is less than the minimum chroma value. If yes, step 912 is executed; otherwise, the reference chroma value is not adjusted.
[0167] In step 912, the electronic device adjusts the reference chroma value to the minimum chroma value.
[0168] In step 913, in response to the fact that the color intensity value range includes the maximum brightness value, the electronic device determines whether the reference brightness value is greater than the maximum brightness value. If yes, step 914 is executed; otherwise, step 915 is executed.
[0169] In step 914, the electronic device adjusts the reference brightness value to the maximum brightness value.
[0170] In step 915, in response to the inclusion of a minimum brightness value in the color intensity value range, the electronic device determines whether the reference brightness value is less than the minimum brightness value; if so, step 916 is executed.
[0171] In step 916, the electronic device adjusts the reference brightness value to the minimum brightness value to obtain the target color information.
[0172] In step 917, the electronic device converts the target color information into HEX format.
[0173] In step 918, the electronic device outputs target color information in HEX format.
[0174] In some embodiments, before adjusting the color of interface elements based on target color information, the electronic device can also obtain the color of the text on the interface elements. If the color of the text on the interface elements is dark, the electronic device can further increase the brightness value of the adjusted target color information in one step, and then adjust the color of the interface elements based on the target color information with the increased brightness value.
[0175] In some embodiments, the size of the first step can be determined as needed, and this disclosure does not limit this.
[0176] For example, the first step can be 2, 3, 4, 5, 6, etc.
[0177] In some embodiments, a dark color can be a color with a lightness value less than a preset threshold. For example, a dark color can be a color with a lightness value less than or equal to 80.
[0178] For example, dark colors include, but are not limited to: black, dark blue, purple, etc.
[0179] In some embodiments, the color intensity value includes a lightness value. The color adjustment strategy includes a lightness-based color adjustment strategy. Adjusting the reference color intensity value included in the reference color information according to each color adjustment strategy to obtain at least one target color information corresponding to each color adjustment strategy includes: adjusting the reference lightness value included in the reference color information to each lightness value range in at least one lightness value range to obtain target color information corresponding to each lightness value range.
[0180] Understandably, electronic devices can have at least one range of brightness values preset. Based on this, if an electronic device adjusts the reference color information according to a brightness-based color adjustment strategy, the reference brightness values included in the reference color information can be adjusted to each brightness value range. At this point, the electronic device can obtain the target color information corresponding to each brightness value range.
[0181] In some embodiments, the electronic device may have a first lightness value range and a second lightness value range preset in advance. Based on this, the electronic device can adjust the reference lightness value included in the reference color information to the first lightness value range to obtain the target color information corresponding to the first lightness value range. The electronic device can also adjust the reference lightness value included in the reference color information to the second lightness value range to obtain the target color information corresponding to the second lightness value range.
[0182] In some embodiments, the lower limit of the second brightness value range is greater than the upper limit of the first brightness value range.
[0183] In some embodiments, the target color information corresponding to the first brightness value range is used to adjust the color of interface elements with light-colored characters. The target color information corresponding to the second brightness value range is used to adjust the color of interface elements with dark-colored characters.
[0184] In some embodiments, after obtaining the target color information corresponding to the first brightness value range and / or the target color information corresponding to the second brightness value range, the electronic device can also obtain the color of the characters on the target interface element. If the color of the characters on the target interface element is light, the electronic device can adjust the color of the target interface element using the target color information corresponding to the first brightness value range. If the color of the characters on the target interface element is dark, the electronic device can adjust the color of the target interface element using the target color information corresponding to the second brightness value range.
[0185] In some embodiments, a light color can be a color with a brightness value greater than a preset threshold.
[0186] For example, light colors include, but are not limited to: white, light yellow, light blue, etc.
[0187] In some embodiments, the first brightness value range and the second brightness value range can both be set as needed, and the embodiments disclosed herein do not limit this.
[0188] For example, the first lightness value range can be a preset multiple of the first lightness value to the reference lightness value (including the lightness values at both ends). The second lightness value range can be the second lightness value to 100 (both the first and second lightness value ranges include the lightness values at both ends).
[0189] In some embodiments, the preset multiplier can be a value greater than 0 and less than 1. For example, the preset multiplier can be 0.6.
[0190] In some embodiments, the first lightness value can be set as needed, and this disclosure does not limit this. For example, the first lightness value can be any value from 10 to 15 in the TCH color space. For example, the first lightness value can be 10, 11, 12, 13, 14, 15, etc.
[0191] In some embodiments, the second lightness value is greater than the first lightness value. For example, the second lightness value can be any value between 85 and 95 in the TCH color space. For example, the second lightness value can be 85, 87, 90, 93, 95, etc.
[0192] In some embodiments, the first brightness value range can be from 0 to a brightness threshold, and the second brightness value range can be from the brightness threshold to 100.
[0193] In some embodiments, the brightness threshold can be set as needed, and this disclosure does not limit this.
[0194] For example, the brightness threshold can be any value between 70 and 90. For instance, the brightness threshold can be 70, 75, 80, 85, 90, etc.
[0195] In some embodiments, if the reference brightness value is within the range of the first brightness value, the electronic device may reduce the reference brightness value in a second step and use the reference color information after the reference brightness value is reduced as the target color information.
[0196] In some embodiments, the size of the second step can be determined as needed, and this disclosure does not limit this.
[0197] For example, the second step can be any value from 7 to 10. For instance, the second step can be 7, 8, 9, 10, etc.
[0198] In some embodiments, if the reference lightness value is within the range of the second lightness value, the electronic device can use the reference color information as the target color information.
[0199] In some embodiments, the color intensity value further includes a chroma value, and the various color adjustment strategies include a chroma-based color adjustment strategy. Adjusting the reference lightness value included in the reference color information to each lightness value range within at least one lightness value range to obtain target color information corresponding to each lightness value range further includes: adjusting the reference lightness value included in the reference color information to each lightness value range to obtain first color information corresponding to each lightness value range; obtaining the chroma value included in the first color information; adjusting the chroma value included in the first color information to the chroma threshold in response to the first color information being greater than a chroma threshold to obtain target color information corresponding to each lightness value range; and determining the first color information corresponding to each lightness value range as target color information corresponding to each lightness value range in response to the first color information being less than or equal to the chroma threshold.
[0200] Understandably, the electronic device can also adjust the reference lightness values included in the reference color information to each lightness value range, and use the reference color information whose reference lightness values fall within the lightness value range as the first color information. At this point, the electronic device can obtain the first color information corresponding to each lightness value range. Then, the electronic device can obtain the chroma value of the first color information. If the chroma value of the first color information is greater than a chroma threshold, the electronic device can adjust the chroma value of the first color information to the chroma threshold, and use the first color information whose chroma value is the chroma threshold as the target color information. Based on this, the electronic device can obtain the target color information corresponding to each lightness value range. If the chroma values included in the first color information are less than or equal to the chroma threshold, the electronic device can use the first color information corresponding to each lightness value range as the target color information corresponding to that lightness value range.
[0201] In some embodiments, the electronic device can adjust the reference lightness value included in the reference color information to a first lightness value range to obtain first color information corresponding to the first lightness value range. Then, the electronic device can acquire the chroma value in the first color information corresponding to the first lightness value range. If the chroma value in the first color information corresponding to the first lightness value range is greater than a chroma threshold, the electronic device can adjust the chroma value in the first color information to the chroma threshold and use the first color information with the adjusted chroma value as the target color information corresponding to the first lightness value range. If the chroma value included in the first color information corresponding to the first lightness value range is less than or equal to the chroma threshold, the electronic device can use the first color information corresponding to the first lightness value range as the target color information corresponding to the first lightness value range.
[0202] In some embodiments, the electronic device can adjust a reference lightness value to a second lightness value range to obtain first color information corresponding to the second lightness value range. Then, the electronic device can acquire the chroma values included in the first color information corresponding to the second lightness value range. If the chroma values included in the first color information corresponding to the second lightness value range are greater than a chroma threshold, the electronic device can adjust the chroma values included in the first color information to the chroma threshold and use the first color information with the adjusted chroma values as the target color information corresponding to the second lightness value range. If the chroma values included in the first color information corresponding to the second lightness value range are less than or equal to the chroma threshold, the electronic device can use the first color information corresponding to the second lightness value range as the target color information corresponding to the second lightness value range.
[0203] In some embodiments, the chroma threshold can be set as needed, and this disclosure does not limit this.
[0204] For example, the chroma threshold can be any value between 40 and 60. For instance, the chroma threshold can be 40, 45, 50, 60, etc.
[0205] In some embodiments, after obtaining the first color information, if the first color information is in the HCT color space, the electronic device can convert the first color information to the HSB color space. Then, the electronic device can obtain the saturation value of the first color information in the HSB color space and compare the obtained saturation value with a saturation threshold. If the saturation value of the first color information in the HSB color space is greater than the saturation threshold, the electronic device can adjust the saturation value of the first color information in the HSB color space to the saturation threshold. In the HSB color space, H represents hue, S represents saturation, and B represents brightness.
[0206] In some embodiments, after adjusting the saturation value in the first color information in the HSB color space to a saturation threshold, the electronic device can also convert the first color information with a saturation value of the saturation threshold from the HSB color space to the HCT color space.
[0207] In some embodiments, after adjusting the saturation value in the first color information in the HSB color space to a saturation threshold, the electronic device can also convert the first color information with a saturation value of the saturation threshold to HEX format to obtain first color information with HEX format.
[0208] In some embodiments, the saturation threshold can be set as needed, and this disclosure does not limit this.
[0209] For example, the saturation threshold can be any value between 65 and 80. For instance, the chroma threshold can be 65, 70, 75, 80, etc.
[0210] For example, Figure 10 This is a schematic flowchart illustrating a second method for adjusting reference color information according to an exemplary embodiment. In the following text, reference will be made to... Figure 10 The steps shown below describe the process of adjusting the lightness value in the reference color information. Specifically:
[0211] In step 1001, the electronic device can extract reference color information in the ARGB color space from the first image on the target interface using the Palette API.
[0212] In step 1002, the electronic device converts the reference color information in the ARGB color space into the reference color information in the HCT color space.
[0213] In step 1003, the electronic device calculates the reference color information in the HCT color space, including 0.6 times the reference lightness value (reference). Figure 10(0.6 Tone).
[0214] In step 1004, the electronic device determines whether 0.6Tone is less than 12. If yes, step 1005 is executed; otherwise, step 1006 is executed.
[0215] In step 1005, the electronic device adjusts the reference brightness value to 12.
[0216] In step 1006, the electronic device adjusts the reference brightness value to 0.6Tone to obtain the first color information corresponding to the first brightness value range.
[0217] In step 1007, the electronic device acquires the chroma value included in the first color information.
[0218] It should be noted that the chroma values included in the first color information may be adaptively adjusted based on the lightness values included in the first color information. Therefore, the chroma values included in the first color information may be the baseline chroma values, or they may not be the baseline chroma values.
[0219] In step 1008, the electronic device converts the first color information to the HSB color space to obtain the first color information in the HSB color space.
[0220] In step 1009, the electronic device determines whether the saturation value of the first color information in the HSB color space is greater than the saturation threshold 70. If yes, steps 1010 and 1012 are executed; if no, steps 1011 and 1012 are executed.
[0221] In step 1010, the electronic device adjusts the saturation value of the first color information to 70 to obtain the target color information.
[0222] In step 1011, the electronic device uses the first color information as the target color information.
[0223] In step 1012, the electronic device outputs target color information in HEX format.
[0224] Figure 11 This is a flowchart illustrating a fourth interface processing method according to an exemplary embodiment. In the following text, it will be referred to as... Figure 11 The target interface shown in the figure (reference) Figure 11 Taking interface 11a as an example, the process of adjusting the reference brightness value of the reference color information to obtain the target color information using a brightness-based color adjustment strategy, and the process of adjusting interface elements (see reference) based on the target color information. Figure 11 The process of adjusting the color of the background 111a) is explained.
[0225] Specifically as follows:
[0226] In step 1101, the electronic device can extract reference color information in the ARGB color space from the first image 112a on the interface 11a via the Palette API (see reference). Figure 11 (Chinese ARGB: 0xFF172040).
[0227] In step 1102, the electronic device converts the reference color information in the ARGB color space to the reference color information in the HCT color space (reference). Figure 11 HCT values: 281, 72, 36.
[0228] In step 1103, the electronic device adjusts the reference brightness value 36 to 21.6 (0.6 times 36).
[0229] It should be noted that, due to the mapping relationship between lightness and chroma values, when the base lightness value is 21.6, the chroma value in the base color information will be adjusted to 66 along with the lightness value.
[0230] In step 1104, in response to the lightness value 21.6 being greater than the first lightness value 12, the electronic device can obtain the first color information (reference). Figure 11 HCT values: 281, 66, 21.6.
[0231] In step 1105, the electronic device will use the first color information (reference) Figure 11 The HCT (281, 66, 21.6) values are converted to the HSB color space to obtain the first color information in the HSB color space (see reference). Figure 11 HSB: #0013A7.
[0232] In step 1106, since the saturation value of 100 included in the first color information under the HSB color space is greater than the saturation threshold of 70, the electronic device adjusts the saturation value included in the first color information to 70 in order to obtain the target color information.
[0233] In step 1107, the electronic device converts the target color information back to the HCT color space to obtain the target color information in the HCT color space (reference). Figure 11 HCT values: 281, 49, 21.6.
[0234] In step 1108, the electronic device will use the target color information (reference) in the HCT color space. Figure 11 The HCT (281, 49, 21.6) is converted to HEX format, and the background color of interface 11a is adjusted based on the target color information (HEX: #1F287D) in HEX format.
[0235] It should be noted that the target color information (#1F287D) in HEX format is dark blue. Figure 11 (Not shown in the image).
[0236] Figure 12 This is a flowchart illustrating a fifth interface processing method according to an exemplary embodiment. In the following text, it will be referred to as... Figure 12 The target interface shown in the figure (reference) Figure 12 Taking interface 12a as an example, the target color information is obtained by adjusting the reference brightness value of the reference color information using a color adjustment strategy, and the interface elements are adjusted based on the target color information. Figure 12 The process of adjusting the color of the background 121a) is explained.
[0237] In step 1201, the electronic device can extract reference color information in the ARGB color space from the first image 122a on the interface 12a via the Palette API (see reference). Figure 12 (ARGB: 0xFF002F64).
[0238] In step 1202, the electronic device converts the reference color information in the ARGB color space to the reference color information in the HCT color space (reference). Figure 12 HCT values: 263, 39, 20.
[0239] In step 1203, the electronic device adjusts the reference brightness value 20 to 95 (adjusting the reference brightness value to the second brightness value range: 90 to 100).
[0240] It should be noted that when the lightness value is 95, the chroma value will be automatically adjusted to 11.
[0241] In step 1204, the electronic device determines whether to correct the reference brightness value 95.
[0242] It should be noted that since the brightness value of 95 is greater than 90, no correction is required.
[0243] In step 1205, the electronic device will store the first color information (reference) corresponding to the second brightness value range. Figure 12 Convert the HCT (264, 11, 95) color space to the HSB color space.
[0244] In step 1206, the electronic device determines whether the saturation value included in the first color information in the HSB color space is greater than the saturation threshold 70.
[0245] In step 1207, in response to the target color information including a saturation value of less than 70, the electronic device uses the first color information as the target color information and converts it into HEX format.
[0246] In step 1208, the electronic device adjusts the color of the background 121a of the interface 12a based on the target color information in HEX format (HEX: #1F287D).
[0247] It should be noted that the target color information (#1F287D) in HEX format is light blue. Figure 12 (Not shown in the image).
[0248] In this embodiment of the disclosure, if the chroma value included in the first color information is greater than the chroma threshold, the chroma value included in the first color information is adjusted to the chroma threshold to obtain the target color information. Based on this, after adjusting the color of the interface elements based on the target color information, the probability of the adjusted interface elements being too bright and causing visual conflict can be reduced.
[0249] In some embodiments, the method further includes: determining character color information corresponding to target color information in each brightness value range; wherein the target color information in each brightness value range is used to adjust the color of at least one interface element, and the character color information is used to adjust the color of characters on at least one interface element.
[0250] Understandably, after obtaining the target color information corresponding to each range of brightness values, the electronic device can determine the character color information corresponding to the target color information within each range of brightness values. Based on this, the electronic device can obtain the character color information corresponding to each target color information. For a given interface element, the electronic device can adjust the color of the interface element based on a target color information, and adjust the color of the characters on the interface element based on the character color information corresponding to that target color information.
[0251] In some embodiments, if the lightness value of the target color information is within a first lightness value range, the electronic device can determine that the character color information corresponding to the target color information is a light-colored character color information. If the lightness value of the target color information is within a second lightness value range, the electronic device can determine that the character color information corresponding to the target color information is a dark-colored character color information. Based on this, the electronic device can adjust the color of the interface elements based on the target color information within the first lightness value range, and adjust the color of the characters on the interface elements based on the light-colored character color information. The electronic device can also adjust the color of the interface elements based on the target color information within the second lightness value range, and adjust the color of the characters on the interface elements based on the dark-colored character color information.
[0252] In some embodiments, the electronic device may adjust the color of all characters on the interface element, or it may adjust the color of some characters on the interface element. This disclosure does not limit this.
[0253] For example, Figure 13 This is a flowchart illustrating a third method for adjusting reference color information according to an exemplary embodiment. Hereinafter, reference will be made to... Figure 13 The steps shown below describe the process of adjusting the lightness value in the reference color information. Specifically:
[0254] In step 1301, the electronic device can extract reference color information in the ARGB color space from the first image on the target interface using the Palette API.
[0255] In step 1302, the electronic device converts the reference color information in the ARGB color space to the reference color information in the HCT color space.
[0256] In step 1303, the electronic device determines whether the reference lightness value Tone included in the reference color information under the HCT color space is less than or equal to the lightness threshold. If yes, it means that the reference lightness value is within the first lightness value range, and steps 1304 to 1306 are executed. If no, it means that the reference lightness value is within the second lightness value range, and steps 1307 to 1309 are executed.
[0257] In step 1304, the electronic device adjusts the reference brightness value to Tone minus 8 to obtain the target color information.
[0258] In step 1305, the electronic device determines that the character color information corresponding to the target color information is light-colored character color information.
[0259] In step 1306, the electronic device converts the target color information and the light-colored character color information into HEX format to obtain the target color information and the character color information in HEX format.
[0260] In step 1307, the electronic device uses the reference color information as the target color information.
[0261] In step 1308, the electronic device determines that the character color information corresponding to the target color information is dark character color information.
[0262] In step 1309, the electronic device converts the target color information and the dark character color information into HEX format to obtain the target color information and the character color information in HEX format.
[0263] Figure 14This is a flowchart illustrating a sixth interface processing method according to an exemplary embodiment. In the following text, it will be referred to as... Figure 14 The target interface shown in the figure (reference) Figure 14 Taking interface 14a as an example, the brightness-based color adjustment strategy is applied to interface elements (see reference). Figure 14 This document explains the process of adjusting the color of the dashed area in images 141a and 141b, as well as the color of the text on interface elements. Details are as follows:
[0264] In step 1401, the electronic device can access the image from the bottom 30% area of the image 141a on the interface 14a via the Palette API. Figure 14 Extract the base color information in the ARGB color space from the dashed area in the image (reference). Figure 14 (Chinese ARGB: 0xFF191A30).
[0265] In step 1402, the electronic device converts the reference color information in the ARGB color space to the reference color information in the HCT color space (reference). Figure 14 HCT values: 305, 19, 11.
[0266] In step 1403, since the lightness value 11 included in the reference color information is less than the lightness threshold 80, the electronic device adjusts the lightness value 11 in the reference color information to 3. At this time, the electronic device can obtain the target color information (HCT: 305, 19, 3) and the light-colored character color information corresponding to the first lightness value range.
[0267] In step 1404, the electronic device converts the target color information corresponding to the first brightness value range and the light-colored character color information into HEX format.
[0268] In step 1405, the electronic device adjusts the color of the dashed area of image 141a to the color indicated by the target color information (#0F071C).
[0269] In step 1406, the electronic device adjusts the color of the text on image 141a to white as indicated by the light character color information (#FFF).
[0270] In step 1407, the electronic device can extract the reference color information in the ARGB color space from the dashed area 141b on interface 14a using the Palette API (see reference). Figure 14 (ARGB: 0xFFECCC77).
[0271] In step 1408, the electronic device converts the reference color information in the ARGB color space to the reference color information in the HCT color space (reference). Figure 14 HCT values: 91, 35, 83.
[0272] In step 1409, since the reference lightness value 83 included in the reference color information extracted from image 141b is greater than the lightness threshold 80, the electronic device can keep the reference color information unchanged (HCT: 91, 35, 83). At this time, the electronic device can use the reference color information as the target color information corresponding to the second lightness value range and determine the dark character color information.
[0273] In step 1410, the electronic device converts the target color information (HCT: 91, 35, 83) and the dark character color information into HEX format.
[0274] In step 1411, the electronic device adjusts the color of the dashed area of image 141b to the color indicated by the target color information (#ECCC77).
[0275] In step 1412, since the brightness value 83 in the reference color information is greater than the brightness threshold 80, the electronic device can adjust the color of the font on image 141b to the darker character color information (see reference). Figure 14 The color information on it: #000 indicates black.
[0276] It should be noted that the small images on the left show images 141a and 141b before the colors were adjusted, while the images 141a and 141b on the target interface on the right are images 141a and 141b after the colors were adjusted.
[0277] In this embodiment, if the brightness value in the target color information is greater than or equal to the brightness threshold, it indicates that the color of the interface element adjusted using the target color information will be relatively bright. In this case, adjusting the color of the characters on the interface element to a darker color can increase the contrast between the characters and the background, thereby improving the clarity of the characters. If the brightness value in the target color information is less than the brightness threshold, it indicates that the color of the interface element adjusted using the target color information will be relatively dark. In this case, adjusting the color of the characters on the interface element to a lighter color can increase the contrast between the characters and the background, thereby improving the clarity of the characters.
[0278] In some embodiments, the first image is an image on the target interface.
[0279] In some embodiments, the first image can be any image on the target interface, and this disclosure does not limit this.
[0280] For example, the first image includes, but is not limited to: a theme image on the target interface, an application icon on the target interface, a product image on the target interface, an album cover on the target interface, an application recommendation card on the target interface, a brand icon on the target interface, etc.
[0281] Figure 15 This is a block diagram illustrating an interface processing apparatus according to an exemplary embodiment. Figure 15 As shown, the device includes: an extraction module 1501 configured to extract reference color information from a first image in response to receiving a first image; a first determination module 1502 configured to determine at least one target color information corresponding to each color adjustment strategy based on the reference color information and multiple color adjustment strategies; and an adjustment module 1503 configured to adjust the color of at least one interface element on a target interface based on multiple target color information obtained according to multiple color adjustment strategies.
[0282] In some embodiments, the adjustment module 1503 is configured to: in response to detecting an association operation between a first target color information among a plurality of target color information and a target interface element on a target interface, adjust the color of the target interface element using the first target color information.
[0283] In some embodiments, the color information includes a color intensity value; the first determining module 1502 is configured to: adjust the reference color intensity value included in the reference color information according to each color adjustment strategy to obtain at least one target color information corresponding to each color adjustment strategy.
[0284] In some embodiments, the color information further includes a hue value; the color adjustment strategy includes a hue-based color adjustment strategy; the first determining module 1502 is configured to: determine the range of color intensity values corresponding to the reference hue value included in the reference color information; determine whether the reference color intensity value is within the range of color intensity values; and adjust the reference color intensity value to the range of color intensity values in response to the reference color intensity value being outside the range of color intensity values, thereby obtaining at least one target color information.
[0285] In some embodiments, the first determining module 1502 is configured to: adjust the reference color intensity value to the maximum color intensity value in response to the reference color intensity value being greater than the maximum color intensity value in the color intensity value range; and adjust the reference color intensity value to the minimum color intensity value in response to the reference color intensity value being less than the minimum color intensity value in the color intensity value range.
[0286] In some embodiments, the first determining module 1502 is configured to: determine whether there is a target reference color group among the plurality of reference color groups whose hue value is the same as the reference hue value; wherein each reference color group includes an upper limit value of color intensity, a lower limit value of color intensity, and at least one hue value; in response to the existence of a target reference color group among the plurality of reference color groups, determine the range composed of the lower limit value of color intensity included in the target reference color group and the upper limit value of color intensity included in the target reference color group as the color intensity value range.
[0287] In some embodiments, the first determining module 1502 is further configured to: in response to the absence of a target reference color group among the plurality of reference color groups, determine adjacent first reference color groups and second reference color groups from the plurality of reference color groups; wherein, a reference hue value is located between the hue values included in the first reference color group and the hue values included in the second reference color group; determine a maximum color intensity value based on the reference hue value, the upper limit value of color intensity and the hue value included in the first reference color group, and the upper limit value of color intensity and the hue value included in the second reference color group; determine a minimum color intensity value based on the reference hue value, the lower limit value of color intensity and the hue value included in the first reference color group, and the lower limit value of color intensity and the hue value included in the second reference color group; and determine a color intensity value range based on the minimum color intensity value and the maximum color intensity value.
[0288] In some embodiments, the color intensity value includes a lightness value, and the color adjustment strategy includes a lightness-based color adjustment strategy; the first determining module 1502 is configured to: adjust the reference lightness value included in the reference color information to each lightness value range in at least one lightness value range, so as to obtain the target color information corresponding to each lightness value range.
[0289] In some embodiments, the color intensity value further includes a chroma value, and the color adjustment strategy includes a chroma-based color adjustment strategy; the first determining module 1502 is configured to: adjust the reference lightness value included in the reference color information to each lightness value range to obtain first color information corresponding to each lightness value range; obtain the chroma value included in the first color information; in response to the chroma value included in the first color information being greater than a chroma threshold, adjust the chroma value included in the first color information to the chroma threshold to obtain target color information corresponding to each lightness value range; in response to the chroma value included in the first color information being less than or equal to the chroma threshold, determine the first color information corresponding to each lightness value range as target color information corresponding to each lightness value range.
[0290] In some embodiments, the apparatus further includes: a second determining module configured to determine character color information corresponding to target color information in each brightness value range; wherein the target color information in each brightness value range is used to adjust the color of at least one interface element in the target interface, and the character color information is used to adjust the color of a character in at least one interface element.
[0291] In some embodiments, the first image is an image on the target interface.
[0292] Regarding the apparatus of the above embodiments, the specific manner in which each module performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated upon here.
[0293] Figure 16 This is a structural block diagram illustrating an electronic device 1600 according to an exemplary embodiment. For example, the electronic device 1600 may be a mobile phone, tablet computer, smartwatch, vehicle-mounted device, or other communication device.
[0294] Reference Figure 16 The electronic device 1600 may include one or more of the following components: processing component 1602, memory 1604, power supply component 1606, multimedia component 1608, audio component 1610, input / output (I / O) interface 1612, sensor component 1614, and communication component 1616.
[0295] Processing component 1602 typically controls the overall operation of electronic device 1600, such as operations associated with at least one of display, telephone call, data communication, camera operation, and recording operation. Processing component 1602 may include one or more processors 1620 to execute instructions to perform all or part of the steps of the methods described above. Furthermore, processing component 1602 may include one or more modules to facilitate interaction between processing component 1602 and other components. For example, processing component 1602 may include a multimedia module to facilitate interaction between multimedia component 1608 and processing component 1602.
[0296] Memory 1604 is configured to store various types of data to support operation on electronic device 1600. Examples of such data include at least one of the following: instructions for any application or method operating on electronic device 1600, contact data, phonebook data, messages, pictures, and videos. Memory 1604 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read-Only Memory (EPROM), Programmable Read Only Memory (PROM), Read-Only Memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.
[0297] Power supply component 1606 provides power to various components of electronic device 1600. Power supply component 1606 may include at least one of the following: a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to electronic device 1600.
[0298] Multimedia component 1608 includes a screen that provides an output interface between electronic device 1600 and a user. In some embodiments, the screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a Touch Panel, the screen may be implemented as a touchscreen to receive input signals from the user. The Touch Panel includes one or more touch sensors to sense touches, swipes, and gestures on the Touch Panel. The touch sensors may sense not only the boundaries of touch or swipe actions but also the duration and pressure associated with the touch or swipe operation. In some embodiments, multimedia component 1608 includes a front-facing camera and / or a rear-facing camera. When electronic device 1600 is in an operating mode, such as a shooting mode or a video mode, the front-facing camera and / or rear-facing camera may receive external multimedia data. Each front-facing camera and rear-facing camera may be a fixed optical lens system or have focal length and optical zoom capabilities.
[0299] Audio component 1610 is configured to output and / or input audio signals. For example, audio component 1610 includes a microphone (MIC) configured to receive external audio signals when electronic device 1600 is in an operating mode, such as call mode, recording mode, and voice recognition mode. The received audio signals may be further stored in memory 1604 or transmitted via communication component 1616. In some embodiments, audio component 1610 also includes a speaker for outputting audio signals.
[0300] I / O interface 1612 provides an interface between processing component 1602 and peripheral interface modules, such as keyboards, click wheels, and buttons. These buttons may include, but are not limited to, home buttons, volume buttons, power buttons, and lock buttons.
[0301] Sensor assembly 1614 includes one or more sensors for providing state assessments of various aspects of electronic device 1600. For example, sensor assembly 1614 may detect the on / off state of electronic device 1600, the relative positioning of components such as the display and keypad of electronic device 1600, changes in position of electronic device 1600 or one of its components, the presence or absence of user contact with electronic device 1600, orientation or acceleration / deceleration of electronic device 1600, and temperature changes of electronic device 1600. Sensor assembly 1614 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. Sensor assembly 1614 may also include an optical sensor, such as a complementary metal-oxide-semiconductor (CMOS) or charge-coupled device (CCD) image sensor, for use in imaging applications. In some embodiments, sensor assembly 1614 may also include, but is not limited to, at least one of the following: an accelerometer, a gyroscope, a magnetometer, a pressure sensor, and a temperature sensor.
[0302] Communication component 1616 is configured to facilitate wired or wireless communication between electronic device 1600 and other devices. Electronic device 1600 can access wireless networks based on communication standards, such as Wi-Fi, 4G, 5G, or combinations thereof. In one exemplary embodiment, communication component 1616 receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, communication component 1616 also includes a Near Field Communication (NFC) module to facilitate short-range communication. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID), Infrared Data Association (IrDA), Ultra Wide Band (UWB), Bluetooth (BT), and other technologies.
[0303] In an exemplary embodiment, the electronic device 1600 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components.
[0304] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 1604 including executable instructions or a computer program, which can be executed by a processor 1620 of an electronic device 1600 to perform the above-described method. For example, the non-transitory computer-readable storage medium may be a ROM, random access memory (RAM), a compact disc read-only memory (CD-ROM), magnetic tape, floppy disk, and optical data storage device, etc.
[0305] A non-transitory computer-readable storage medium, when instructions on the storage medium are executed by a processor of an electronic device, enables the electronic device to perform any of the interface processing methods described in the embodiments of this disclosure. The method includes:
[0306] In response to receiving a first image, the system extracts reference color information from the first image; based on the reference color information and multiple color adjustment strategies, it determines at least one target color information corresponding to each color adjustment strategy; and based on the multiple target color information obtained according to the multiple color adjustment strategies, it adjusts the color of at least one interface element on the target interface.
[0307] This disclosure provides a computer program product comprising a computer program or executable instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer program or executable instructions from the computer-readable storage medium and executes the computer program or executable instructions, causing the computer device to perform any of the interface processing methods described in this disclosure.
[0308] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the claims.
[0309] It should be understood that this disclosure is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this disclosure is limited only by the appended claims.
Claims
1. An interface processing method, characterized in that, The method includes: In response to receiving a first image, reference color information is extracted from the first image; Based on the baseline color information and multiple color adjustment strategies, at least one target color information corresponding to each color adjustment strategy is determined; Based on multiple target color information obtained according to the various color adjustment strategies, the color of at least one interface element on the target interface is adjusted.
2. The method according to claim 1, characterized in that, The step of adjusting the color of at least one interface element on the target interface based on multiple target color information obtained according to the multiple color adjustment strategies includes: In response to detecting an association operation between a first target color information among the plurality of target color information and a target interface element on the target interface, the color of the target interface element is adjusted using the first target color information.
3. The method according to claim 1, characterized in that, Color information includes color intensity values; The step of determining at least one target color information corresponding to each color adjustment strategy based on the reference color information and multiple color adjustment strategies includes: The reference color intensity values included in the reference color information are adjusted according to each color adjustment strategy to obtain at least one target color information corresponding to each color adjustment strategy.
4. The method according to claim 3, characterized in that, The color information also includes a hue value; the color adjustment strategy includes a hue-based color adjustment strategy. The step of adjusting the reference color intensity value included in the reference color information according to each color adjustment strategy to obtain at least one target color information corresponding to each color adjustment strategy includes: Determine the range of color intensity values corresponding to the reference hue values included in the reference color information; Determine whether the reference color intensity value is within the range of color intensity values; In response to the reference color intensity value being outside the range of color intensity values, the reference color intensity value is adjusted to be within the range of color intensity values to obtain at least one target color information.
5. The method according to claim 4, characterized in that, The step of adjusting the reference color intensity value to the range of color intensity values in response to the reference color intensity value being outside the range of color intensity values includes: In response to the reference color intensity value being greater than the maximum color intensity value in the color intensity value range, the reference color intensity value is adjusted to the maximum color intensity value; In response to the reference color intensity value being less than the minimum color intensity value in the range of color intensity values, the reference color intensity value is adjusted to the minimum color intensity value.
6. The method according to claim 4, characterized in that, Determining the range of color intensity values corresponding to the reference hue values included in the reference color information includes: Determine whether there exists a target reference color group among multiple reference color groups whose hue value is the same as the reference hue value; wherein each reference color group includes an upper limit value for color intensity, a lower limit value for color intensity, and at least one hue value; In response to the presence of the target reference color group among the plurality of reference color groups, the range consisting of the lower limit of color intensity included in the target reference color group and the upper limit of color intensity included in the target reference color group is determined as the color intensity value range.
7. The method according to claim 6, characterized in that, The step of determining the range of color intensity values corresponding to the reference hue values included in the reference color information further includes: In response to the absence of the target reference color group among the plurality of reference color groups, an adjacent first reference color group and a second reference color group are determined from the plurality of reference color groups; wherein the reference hue value is located between the hue values included in the first reference color group and the hue values included in the second reference color group; Based on the reference hue value, the upper limit of color intensity and hue value included in the first reference color group, and the upper limit of color intensity and hue value included in the second reference color group, the maximum color intensity value is determined; Based on the reference hue value, the lower limit of color intensity and hue value included in the first reference color group, and the lower limit of color intensity and hue value included in the second reference color group, a minimum color intensity value is determined; The range of color intensity values is determined based on the minimum color intensity value and the maximum color intensity value.
8. The method according to claim 3, characterized in that, The color intensity value includes a brightness value, and the color adjustment strategy includes a brightness-based color adjustment strategy. The step of adjusting the reference color intensity value included in the reference color information according to each color adjustment strategy to obtain at least one target color information corresponding to each color adjustment strategy includes: The reference lightness values included in the reference color information are adjusted to each lightness value range within at least one lightness value range to obtain the target color information corresponding to each lightness value range.
9. The method according to claim 8, characterized in that, The color intensity value also includes a chroma value, and the color adjustment strategy includes a chroma-based color adjustment strategy. The step of adjusting the reference lightness values included in the reference color information to at least one lightness value range to obtain the target color information corresponding to each lightness value range further includes: The reference lightness values included in the reference color information are adjusted to each lightness value range to obtain the first color information corresponding to each lightness value range; Obtain the chroma value included in the first color information; In response to the fact that the chroma value included in the first color information is greater than the chroma threshold, the chroma value included in the first color information is adjusted to the chroma threshold to obtain the target color information corresponding to each range of lightness values; In response to a chroma value less than or equal to the chroma threshold included in the first color information, the first color information corresponding to each range of lightness values is determined as the target color information corresponding to each range of lightness values.
10. The method according to claim 8, characterized in that, The method further includes: Determine the character color information corresponding to the target color information in each of the lightness value ranges; The target color information in each brightness value range is used to adjust the color of the at least one interface element, and the character color information is used to adjust the color of the characters on the at least one interface element.
11. The method according to any one of claims 1 to 10, characterized in that, The first image is an image on the target interface.
12. An interface processing device, characterized in that, The device includes: The extraction module is configured to extract reference color information from the first image in response to receiving the first image; The first determining module is configured to determine at least one target color information corresponding to each color adjustment strategy based on the reference color information and multiple color adjustment strategies. The adjustment module is configured to adjust the color of at least one interface element on the target interface based on multiple target color information obtained according to the multiple color adjustment strategies.
13. The apparatus according to claim 12, characterized in that, The adjustment module is configured as follows: In response to detecting an association operation between a first target color information among the plurality of target color information and a target interface element on the target interface, the color of the target interface element is adjusted using the first target color information.
14. The apparatus according to claim 12, characterized in that, Color information includes color intensity values; The first determining module is configured as follows: The reference color intensity values included in the reference color information are adjusted according to each color adjustment strategy to obtain at least one target color information corresponding to each color adjustment strategy.
15. The apparatus according to any one of claims 12 to 14, characterized in that, The first image is an image on the target interface.
16. An electronic device, characterized in that, include: processor; Memory used to store computer programs or instructions; The processor executes the computer program or instructions to implement the steps of the method according to any one of claims 1 to 11.
17. A non-transitory computer-readable storage medium storing a computer program or instructions, characterized in that, When the computer program or instructions of the storage medium are executed by a processor, the steps of the method according to any one of claims 1 to 11 are implemented.
18. A computer program product comprising a computer program or instructions, characterized in that, When the computer program or instructions are executed by a processor, they implement the steps of the method according to any one of claims 1 to 11.