Color conversion method and device, electronic equipment and storage medium

The color conversion method addresses suboptimal RGB color mixing by converting color values through a color wheel and reference table, improving display quality and visibility in digital displays by aligning with traditional color mixing principles.

CN120321378APending Publication Date: 2025-07-15华以超
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510359005.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-25
Publication Date
2025-07-15

AI Technical Summary

Technical Problem

When displaying the RGB color space, the yellow brightness is too high and difficult to identify, and the blue brightness is too low and too dark, resulting in poor color display effect.

Method used

By converting the color value of the object to be displayed in the RGB color space into the RYB color space, the color ring angle value and the color space conversion reference table are used for correction, and the target color value is generated to optimize the display effect.

Benefits of technology

The precise conversion of colors in different spaces is realized, the display effect is optimized, and different colors have similar weights visually, improving the accuracy and interpretation of data visualization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120321378A_ABST
    Figure CN120321378A_ABST
Patent Text Reader

Abstract

The invention provides a color conversion method and device, electronic equipment and a storage medium, and the method comprises the steps: determining a target color ring angle value corresponding to a first color value based on the first color value corresponding to a to-be-displayed object in a first color space; determining a second color value corresponding to the target color ring angle value in a second color space through a color space conversion reference table; correcting the second color value based on the first color value, generating and outputting a target color value corresponding to the to-be-displayed object in the second color space, thereby converting the first color value of the first color space into the second color value of the second color space, and realizing accurate conversion of colors in different spaces; in the embodiment of the invention, the second color space is a color space usually adopted during visualization, and then the second color value is corrected through the first color value, so that the display effect of the second color value is optimized, the target color value with a better display effect is obtained, and the display effect of the color is optimized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the technical field of data visualization, and in particular, to a color conversion method, apparatus, electronic device, and storage medium. Background Art

[0002] In the related art, the three primary colors in optics are red, green, and blue (RGB). Digital image processing and data visualization mainly use the RGB (red, green, blue) color space for color representation and mixing. The RGB color space is based on the principle of additive color mixing, and various colors are generated by different intensity combinations of the RGB three primary colors.

[0003] However, the RGB color space is the standard color space for digital displays. In the standard RGB color space, the brightness of yellow is too high and it is difficult to identify on a white background; while the brightness of blue is too low and it is too dull when displayed, resulting in poor color display effects. Summary of the Invention

[0004] To overcome the problem of poor color display effects in the related art, the present disclosure provides a color conversion method, apparatus, electronic device, and storage medium.

[0005] According to a first aspect of an embodiment of the present disclosure, a color conversion method is provided, including:

[0006] Based on a first color value corresponding to a to-be-displayed object in a first color space, determining a target color ring angle value corresponding to the first color value, where the target color ring angle value is an angle corresponding to the first color value on a color ring;

[0007] Determining a second color value corresponding to the target color ring angle value in a second color space through a color space conversion reference table;

[0008] Correcting the second color value based on the first color value, and generating and outputting a target color value corresponding to the to-be-displayed object in the second color space.

[0009] According to a second aspect of an embodiment of the present disclosure, a color conversion apparatus is provided, including:

[0010] A first determination module configured to determine a target color ring angle value corresponding to a first color value based on the first color value corresponding to a to-be-displayed object in a first color space, where the target color ring angle value is an angle corresponding to the first color value on a color ring;

[0011] A second determination module configured to determine a second color value corresponding to the target color ring angle value in a second color space through a color space conversion reference table;

[0012] An output module, configured to correct the second color value based on the first color value, and generate and output a target color value corresponding to the object to be displayed in the second color space.

[0013] According to a third aspect of the embodiments of the present disclosure, there is provided an electronic device, including:

[0014] A processor;

[0015] A memory for storing instructions executable by the processor;

[0016] Wherein, the processor is configured to execute the color conversion method as described in the first aspect above.

[0017] According to a fourth aspect of the embodiments of the present disclosure, there is provided a non-transitory computer-readable storage medium, which stores a computer program or instructions. When the computer program or instructions in the storage medium are executed by a processor, an electronic device can execute the color conversion method as described in the first aspect above.

[0018] The technical solutions provided by the embodiments of the present disclosure may include the following beneficial effects:

[0019] In the embodiments of the present disclosure, first, the target color ring angle value corresponding to the first color value is determined on the color ring, and then, through the target color ring angle value and the color space conversion reference table, the first color value in the first color space is converted into the second color value in the second color space, realizing the accurate conversion of colors in different spaces; the second color space is a color space commonly used in visualization. Furthermore, the second color value is corrected by the first color value, optimizing the display effect of the second color value, obtaining a target color value with a better display effect, thereby optimizing the display effect of the color. Finally, the target color value is output for display, facilitating the user to view.

[0020] It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and cannot limit the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] The accompanying drawings herein are incorporated into the specification and form a part of the specification, showing embodiments consistent with the present disclosure and used together with the specification to explain the principles of the present disclosure.

[0022] Figure 1 is a flowchart of a color conversion method provided by an embodiment of the present disclosure;

[0023] Figure 2 is a schematic diagram of a color ring provided by an embodiment of the present disclosure;

[0024] Figure 3It is a schematic diagram of another color conversion method provided by an embodiment of the present disclosure;

[0025] Figure 4 It is a flowchart of visualizing multi-dimensional features of single-cell RNA sequencing data provided by an embodiment of the present disclosure;

[0026] Figure 5 It is a schematic structural diagram of a color conversion device provided by an embodiment of the present disclosure;

[0027] Figure 6 It is a structural block diagram of an electronic device provided by an embodiment of the present disclosure. Detailed implementation manners

[0028] Here, exemplary embodiments will be described in detail, and examples are shown in the accompanying drawings. When the following description refers to the accompanying drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementation manners described in the following exemplary embodiments do not represent all implementation manners consistent with the present disclosure. On the contrary, they are merely examples of devices consistent with some aspects of the present disclosure as detailed in the appended claims.

[0029] In the related art, the color mixing result obtained based on the RGB color space is different from the color mixing result that people are used to in real life. The reason for the difference is that the color mixing based on the RGB color space is a color mixing based on the optical principle, which is equivalent to superimposing lights of different colors in the dark; the color mixing that people come into contact with in real life is usually superimposing pigments on white paper. People are more used to the pigment superimposition in real life and are not used to the superimposition of lights of different colors, and the color display effect obtained by the superimposition of lights is also not good.

[0030] To solve the problem of poor color display effect, the present disclosure provides a color conversion method. Figure 1 It is a flowchart of a color conversion method provided by an embodiment of the present disclosure. This method is applied to an electronic device, as Figure 1 shown. This method includes steps 101 to 103, where:

[0031] Step 101: Based on the first color value of the object to be displayed in the first color space, determine the target color ring angle value corresponding to the first color value. The target color ring angle value is the angle corresponding to the first color value on the color ring.

[0032] In the embodiments of the present disclosure, the first color space is a color space that is the same as the cognitive habit of humans for color mixing in real life. For example, the first color space is a color space based on the primary colors of pigments in fine arts. The first color space includes the red-yellow-blue (RYB) color space, and the first color space is composed of the three primary colors of RYB and the mixing principle of the three primary colors. Among them, the primary color refers to the basic color that cannot be obtained by mixing and blending other colors. The object to be displayed includes one or more of objects such as lines, graphics, texts, characters, images, and window backgrounds. Among them, the line can be a straight line, a curve, a dotted line, or a line segment with an arrow, and the graphics include regular graphics or irregular graphics, etc. Here, the object to be displayed is not limited.

[0033] The first color value is composed of the primary color values of the first color space. For example, when the first color space is the RYB color space, the first color value is equivalent to the color generated on white paper based on at least one of the three primary colors of red, yellow, and blue. The first color value includes the red primary color value, the yellow primary color value, and the blue primary color value of the red-yellow-blue (RYB) color space. The first color value is obtained by mixing the red primary color value, the yellow primary color value, and the blue primary color value. Among them, the red primary color value refers to the brightness value of the red color, the yellow color value refers to the brightness value of the yellow color, and the blue color value refers to the brightness value of the blue color. Therefore, the first color value obtained based on the pigment mixing principle is more in line with the color mixing habits of humans in traditional art and real life, and is convenient for users to interpret the mixed color.

[0034] Figure 2 It is a schematic diagram of a color wheel provided by the embodiments of the present disclosure, as Figure 2 shown. Multiple angles are marked on the color wheel, which are the angles corresponding to the three primary colors and the angles corresponding to the three secondary colors respectively. Among them, the three primary colors refer to the red-yellow-blue (RYB) colors, and the three secondary colors refer to orange, purple, and green. The angle corresponding to the red primary color is 0° (or 360°); the angle corresponding to the yellow primary color is 120°; the angle corresponding to the blue primary color is 240°; orange is the primary color obtained by mixing the red primary color and the yellow primary color, and the angle corresponding to orange is 60°; green is the primary color obtained by mixing the yellow primary color and the blue primary color, and the angle corresponding to green is 180°; purple is the primary color obtained by mixing the blue primary color and the red primary color, and the angle corresponding to purple is 300°.

[0035] The electronic device determines the angle of the first color value on the color wheel through the values of each primary color in the first color value, and obtains the target color wheel angle value.

[0036] Step 102: Determine the second color value corresponding to the target color wheel angle value in the second color space through the color space conversion reference table.

[0037] In the embodiments of the present disclosure, the color space conversion reference table includes multiple angular values on the color wheel and the corresponding values in the second color space for each angular value. The second color space includes color spaces commonly used in visualization. For example, digital display devices (including monitors, projectors, etc.) are devices with display functions and usually use color codes in the RGB format as input and display. Due to basic limitations at the hardware level, any color mixed from other color spaces must ultimately be converted into color codes in the RGB format to be displayed on the screen. The second color space includes the RGB color space. Thus, through the color space conversion reference table and the target color wheel angular value, the first color value in the RYB color space is converted into the color value in the second color space, facilitating the display of the mixed color by an electronic device or a digital display device and facilitating the visualization of the mixed color. The digital display device is connected to the electronic device.

[0038] Since there is no corresponding visualization channel for the first color space while there is a corresponding visualization channel for the second color space, the first color value in the first color space can only be converted into the second color value in the second color space to facilitate the user's viewing.

[0039] Step 103: Correct the second color value based on the first color value, and generate and output the target color value corresponding to the object to be displayed in the second color space.

[0040] In the embodiments of the present disclosure, the second color value is corrected according to the first color value to prevent some colors from being overemphasized due to their excessive proportion in the user's vision, and solve the problem that different colors have uneven weights in the user's vision due to uneven brightness, so that different colors have similar weights in visual performance. The electronic device displays the target color value, or sends the target color value to the digital display device for the digital display device to display the target color value, enabling the user to view the target color value through the electronic device or the digital display device.

[0041] For example, the second color space includes the RGB color space, the second color value includes the value of R, the value of G, and the value of B. After mixing the three colors of RGB, the second color value is obtained. Among them, the values of the three colors of R, G, and B refer to brightness values. Correcting the brightness values of the three colors of R, G, and B in the second color value according to the first color value is to balance the brightness of the second color value, and obtain the target color value with optimized brightness, thereby optimizing the brightness effect of the color in digital display.

[0042] Embodiments of the present disclosure provide a color conversion method. Based on a first color value of a display object in a first color space, a target color ring angle value corresponding to the first color value is determined, and the target color ring angle value is the angle corresponding to the first color value on the color ring. Through a color space conversion reference table, a second color value corresponding to the target color ring angle value in a second color space is determined. The second color value is corrected based on the first color value, and a target color value of the display object in the second color space is generated and output. Thus, the target color ring angle value corresponding to the first color value is first determined on the color ring, and then the first color value in the first color space is converted into the second color value in the second color space through the target color ring angle value and the color space conversion reference table, achieving precise conversion of colors in different spaces. The second color space is a color space commonly used in visualization. Furthermore, the second color value is corrected based on the first color value, optimizing the display effect of the second color value, obtaining a target color value with a better display effect, and finally outputting the target color value for display, facilitating viewing by the user.

[0043] In some embodiments, step 101 may include steps 1011 to 1013, where:

[0044] Step 1011: Perform a normalization process on the first color value to generate a normalized color value.

[0045] In embodiments of the present disclosure, the first color value includes a first primary color value, a second primary color value, and a third primary color value, and the normalized color value includes a first standard primary color value, a second standard primary color value, and a third standard primary color value. Performing a normalization process on the first color value includes performing a normalization process on the first color value. The electronic device determines a primary color maximum value and a primary color minimum value from the first primary color value, the second primary color value, and the third primary color value. Based on the primary color maximum value and the primary color minimum value, the first primary color value, the second primary color value, and the third primary color value are respectively normalized to generate a first standard primary color value corresponding to the first primary color value, a second standard primary color value corresponding to the second primary color value, and a third standard primary color value corresponding to the third primary color value.

[0046] When any two of the three primary color values are not equal, that is, the first primary color value is not equal to the second primary color value, the second primary color value is not equal to the third primary color value, and the first primary color value is not equal to the third primary color value, the computing device performs normalization processing on the first primary color value, the second primary color value, and the third primary color value respectively based on the primary color maximum value and the primary color minimum value, and generates a first standard primary color value corresponding to the first primary color value, a second standard primary color value corresponding to the second primary color value, and a third standard primary color value corresponding to the third primary color value, including: generating a first primary color difference based on the first primary color value and the primary color minimum value; generating a second primary color difference based on the primary color maximum value and the primary color minimum value; using the ratio of the first primary color difference to the second primary color difference as the first standard primary color value; generating a third primary color difference based on the second primary color value and the primary color minimum value; using the ratio of the third primary color difference to the second primary color difference as the second standard primary color value; generating a fourth primary color difference based on the third primary color value and the primary color minimum value; using the ratio of the fourth primary color difference to the second primary color difference as the third standard primary color value.

[0047] For example, the user inputs a first color value in the electronic device, the first color value is (r = 0.3, y = 0.5, b = 0.2), the first primary color value is 0.3, the second primary color value is 0.5, and the third primary color value is 0.2. The primary color maximum value is 0.5, and the primary color minimum value is 0.2. The first primary color difference is 0.3 - 0.2 = 0.1, the second primary color difference is 0.5 - 0.2 = 0.3, the first standard primary color value is 1 / 3, or, the first standard primary color value can also be expressed as a decimal, the first standard primary color value is taken to three decimal places, the first standard primary color value is 0.333. Similarly, the second standard primary color value is 1.000, the third standard primary color value is 0.000, and the standardized color value is (r = 0.333, y = 1.000, b = 0.000).

[0048] When the values of two primary colors in the first color value are the same, any one of the values of the two identical primary colors can be used as the primary color maximum value or the primary color minimum value.

[0049] When the values of the three primary colors in the first color value are all the same, the electronic device determines the preset standard primary color value corresponding to the first primary color value; modifies the values of the three primary colors to the preset standard primary color values, and the three preset standard primary color values form the standardized color value. For example, the first color value is (r = 0.3, y = 0.3, b = 0.3), the difference between the maximum value and the minimum value is 0, the preset standard primary color value is 0.5, and the standardized color value is (r = 0.5, y = 0.5, b = 0.5).

[0050] Step 1012: Determine the target color ring range corresponding to the standardized color value on the color ring.

[0051] In the embodiments of the present disclosure, the standardized color values include a first standard primary color value, a second standard primary color value, and a third standard primary color value; when any two of the three standard primary color values are not equal, step 1012 may include: determining the minimum standard primary color value based on the first standard primary color value, the second standard primary color value, and the third standard primary color value; and determining the target color ring range based on the primary color corresponding to the minimum standard primary color value. When the values of two standard primary color values in the standardized color values are the same, either value of the two identical standard primary color values may be used as the maximum standard primary color value or the minimum standard primary color value.

[0052] The minimum standard primary color value is the minimum of the first standard primary color value, the second standard primary color value, and the third standard primary color value. In addition, the maximum standard primary color value and the intermediate standard color value may be determined; the maximum standard primary color value is the maximum of the first standard primary color value, the second standard primary color value, and the third standard primary color value, and the intermediate standard color value is the second largest value of the first standard primary color value, the second standard primary color value, and the third standard primary color value.

[0053] The primary color corresponds to a color ring threshold. For example, as Figure 2 shown, the color ring thresholds include 0°, 120°, 240°, or 360°. When the color ring threshold is 0° or 360°, the corresponding color is the red primary color; when the color ring threshold is 120°, the corresponding color is the yellow primary color; when the color ring threshold is 240°, the corresponding color is the blue primary color. The standardized color value is (r = 0.333, y = 1.000, b = 0.000), the first standard primary color value is 0.333, the second standard primary color value is 1.000, and the third standard primary color value is 0.000. The minimum standard primary color value is the third standard primary color value. Since the third standard primary color value is the value of the blue primary color, the standardized color value is between the red primary color and the yellow primary color on the color ring, and the target color ring range is [0°, 120°]. In addition, the maximum standard primary color value is the second standard primary color value. Since the second standard primary color value is the value of the yellow primary color, the first color ring threshold corresponding to the maximum standard primary color value is 120°; the intermediate standard color value is the first standard primary color value. The first standard primary color value is the value of the red primary color, so the second color ring threshold corresponding to the intermediate standard primary color value is 0°.

[0054] When the values of the three primary colors in the first color value are all the same, step 1012 may include: the electronic device uses any preset standard primary color value as the minimum standard primary color value; and determines the target color ring range based on the primary color corresponding to the minimum standard primary color value. For example, the standardized color value is (r = 0.5, y = 0.5, b = 0.5). The preset standard primary color value corresponding to the red primary color is used as the minimum value. The standardized color value (r = 0.5, y = 0.5, b = 0.5) is between the yellow primary color and the blue primary color on the color ring, and the target color ring range is [120°, 240°].

[0055] Alternatively, the color ring threshold can also be represented by other values. For example, the color ring threshold includes 0, 2, 4, or 6. Here, 0 corresponds to 0°, 2 corresponds to 120°, 4 corresponds to 240°, and 6 corresponds to 360°. When the standard primary color value corresponding to the red primary color is the smallest, the normalized color value is between yellow and blue, and the target color ring range is [2, 4]; when the standard primary color value corresponding to the yellow primary color is the smallest, the normalized color value is between red and blue, and the target color ring range is [4, 6]; when the standard primary color value corresponding to the blue primary color is the smallest, the normalized color value is between red and yellow, and the target color ring range is [0, 2]. Details are not elaborated here.

[0056] Step 1013: Generate a target color ring angle value based on the normalized color value and the target color ring range.

[0057] In the embodiments of the present disclosure, the target color ring range corresponds to a first color ring threshold and a second color ring threshold. The normalized color value includes a standard primary color maximum value and a standard color intermediate value, where the standard primary color maximum value corresponds to the first color ring threshold, and the standard color intermediate value corresponds to the second color ring threshold. The electronic device generates a primary color ratio based on the standard primary color maximum value and the standard color intermediate value; and generates a target color ring angle value based on the primary color ratio, according to the first color ring threshold and the second color ring threshold.

[0058] For example, the target color ring range is [0, 2], the standard color intermediate value is 0.333, and the corresponding primary color is the red primary color; the standard primary color maximum value is 1.000, and the corresponding primary color is the yellow primary color; the primary color ratio is 1:3, that is, the normalized color value is composed of 1 part of the red primary color and 3 parts of the yellow primary color. The first color ring threshold corresponding to the red primary color is 0, and the second color ring threshold corresponding to the yellow primary color is 2. The target color ring angle value x = 1.5. Alternatively, the target color ring angle value x = 1.5 * 60° = 90°.

[0059] Another example, the target color ring range is [2, 4], the standard color intermediate value is 0.5, and the corresponding primary color is the yellow primary color; the standard primary color maximum value is 0.5, and the corresponding primary color is the blue primary color; the primary color ratio is 1:1, that is, the normalized color value is composed of 1 part of the yellow primary color and 1 part of the blue primary color. The first color ring threshold corresponding to the yellow primary color is 2, and the second color ring threshold corresponding to the blue primary color is 4. The target color ring angle value x = 3. Alternatively, the target color ring angle value x = 3 * 60° = 180°.

[0060] In some embodiments, the color space conversion reference table includes the corresponding relationship between the color ring angle value and the conversion preset value; Step 102 includes Step 1021 to Step 1022, where:

[0061] Step 1021: Query whether the color space conversion reference table includes the target color ring angle value. If the color space conversion reference table includes the target color ring angle value, search the color space conversion reference table for the conversion preset value corresponding to the target color ring angle value.

[0062] In the embodiments of the present disclosure, Table 1 is a color space conversion reference table provided by the embodiments of the present disclosure. As shown in Table 1 below,

[0063] Table 1

[0064]

[0065]

[0066] As shown in Table 1 above, the second color space is the RGB color space, which shows the corresponding relationship between the color ring angle value and the RGB color space value. For example, when the color ring angle value is 0 or 6, the corresponding RGB color space value is (R = 1, G = 0.125, B = 0.125), which is pure red with a slight brightness; when the color ring angle value is 2, the corresponding RGB color space value is (R = 1, G = 0.75, B = 0), which is a yellow slightly darker than the standard yellow (R = 1, G = 1, B = 0) in the RGB color space; when the color ring angle value is 4, the corresponding RGB color space value is (R = 0, G = 0.5, B = 1), which is a blue brighter than the standard blue (0, 0, 1) in the RGB color space.

[0067] The electronic device first queries from multiple color ring angle values whether there is a color ring angle value equal to the target color ring angle value. When the target color ring angle value is any integer from 0 to 6, it indicates that the color space conversion reference table includes the target color ring angle value, and the electronic device can directly find the conversion preset value corresponding to the target color ring angle value through Table 1 above. For example, when the target color ring angle value x = 3, the conversion preset value is (R = 0, G = 0.75, B = 0).

[0068] Step 1022: Determine the second color value based on the conversion preset value corresponding to the target color ring angle value.

[0069] In the embodiments of the present disclosure, the conversion preset value corresponding to the target color ring angle value is used as the second color value. For example, the second color value is (R = 0, G = 0.75, B = 0), and the second color value includes 3 values to be corrected, and the value range of the value to be corrected is [0, 1].

[0070] Alternatively, Step 102 includes Step 102A to Step 102B, where:

[0071] Step 102A: Query whether the color space conversion reference table includes the target color ring angle value. In the case where the target color ring angle value is not included in the color space conversion reference table, look up the adjacent color ring angle value corresponding to the target color ring angle value and the conversion preset value corresponding to the adjacent color ring angle value in the color space conversion reference table.

[0072] In the embodiments of the present disclosure, the adjacent color ring angle value is the color ring angle value adjacent to the target color ring angle value, and the adjacent color ring angle value includes the upper adjacent value of the first color ring angle and the lower adjacent value of the second color ring angle; the upper adjacent value of the first color ring angle is the closest color ring angle value less than the target color ring angle value; the lower adjacent value of the second color ring angle is the closest color ring angle value greater than the target color ring angle value. The conversion preset value corresponding to the adjacent color ring angle value includes the upper conversion preset value and the lower conversion preset value. The upper conversion preset value is the conversion preset value corresponding to the upper adjacent value of the first color ring angle, and the lower conversion preset value is the conversion preset value corresponding to the lower adjacent value of the second color ring angle.

[0073] For example, when the target color ring angle value x = 1.5, as shown in Table 1 above, the target color ring angle value x is between the color ring angle value of 1 and the color ring angle value of 2. The upper adjacent value of the first color ring angle is 1, and the upper conversion preset value is (R = 1, G = 0.5, B = 0); the lower adjacent value of the second color ring angle is 2, and the lower conversion preset value is (R = 1, G = 0.75, B = 0).

[0074] Step 102B: Generate the second color value based on the conversion preset value corresponding to the adjacent color ring angle value, the adjacent color ring angle value, and the target color ring angle value through an interpolation algorithm.

[0075] In the embodiments of the present disclosure, 1.5 is exactly the intermediate value between 1 and 2. Through the linear interpolation algorithm, the second color value obtained is (R = 1, G = 0.625, B = 0). The second color value includes 3 values to be corrected, and the value range of the values to be corrected is [0, 1].

[0076] In some embodiments, step 103 may include steps 1031 to 1033, where:

[0077] Step 1031: Determine the color value range based on the first color value.

[0078] In the embodiments of the present disclosure, the first color value includes the first primary color value, the second primary color value, and the third primary color value. The electronic device determines the primary color maximum value and the primary color minimum value from the first primary color value, the second primary color value, and the third primary color value; determines the minimum value of the color value range based on the primary color maximum value, and determines the maximum value of the color value range based on the primary color minimum value; determines the color value range based on the minimum value and the maximum value of the color value range.

[0079] The characteristics of pigment mixing in the real world are as follows: the more pigments used (the higher the ryb value), the darker the mixed color; the fewer pigments used (the lower the ryb value), the closer the mixed color is to the color of white paper. Based on the characteristics of mixing in the real world, determine the color value range corresponding to the target color value.

[0080] For example, the first color value is (r = 0.3, y = 0.5, b = 0.2), the maximum value of the primary color is 0.5, and the minimum value of the primary color is 0.2. The upper limit of the color value range is 1 - min(ryb) = 1 - 0.2 = 0.8, that is, the maximum value of the color value range is 0.8; the lower limit of the color value range is 1 - max(ryb) = 1 - 0.5 = 0.5, that is, the minimum value of the color value range is 0.5, and the color value range is [0.5, 0.8].

[0081] Another example, when the values of the three primary colors in the first color value are the same, the first color value is (r = 0.3, y = 0.3, b = 0.3), indicating that the first color is bright gray, the maximum value and the minimum value of the primary color are both 0.7, and the color value range is a determined color value constant, and the color value constant is 0.7.

[0082] Step 1032: Correct the second color value based on the color value range to generate the target color value.

[0083] In the embodiments of the present disclosure, the second color value includes a value to be corrected, and the target color value includes a target value. When the value to be corrected is not within the color value range, determine the maximum value or the minimum value of the color value range closest to the value to be corrected, and use the maximum value or the minimum value of the color value range closest to the value to be corrected as the target value corresponding to the value to be corrected; when the value to be corrected is within the color value range, through linear interpolation, based on multiple values to be corrected and the color value range, generate the target value corresponding to the value to be corrected within the color value range.

[0084] For example, the second color value is (R = 1, G = 0.625, B = 0). R = 1 is the first value to be corrected, G = 0.625 is the second value to be corrected, and B = 0 is the third value to be corrected. Neither the first value to be corrected nor the third value to be corrected is within the color value range [0.5, 0.8]. The value closest to the first value to be corrected, R = 1, is the maximum value of the color value range, and the first target value is 0.8; the value closest to the third value to be corrected, B = 0, is the minimum value of the color value range, and the third target value is 0.5. By using the linear interpolation method to construct a linear function, the first target value corresponding to the second value to be corrected is found to be 0.6875. Thus, an accurate conversion from the RYB color space to the RGB color space is achieved. The first color value (r = 0.3, y = 0.5, b = 0.2) in the first color space is converted to the second color value (R = 1, G = 0.625, B = 0) in the second color space. Moreover, by carefully correcting the values corresponding to each color in the second color value, the brightness corresponding to each color is adjusted. This not only retains the natural mixing effect in the artistic color theory through the first color space but also optimizes the brightness balance of colors in digital displays, improves the detail visibility in dark areas, and obtains the corrected target color value (R = 0.8000, G = 0.6875, B = 0.5000).

[0085] Again, for example, the second color value is (R = 0, G = 0.75, B = 0). R = 0 is the first value to be corrected, G = 0.75 is the second value to be corrected, and B = 0 is the third value to be corrected. The fixed color value is 0.7, that is, the target value is 0.7, and the target color value is (R = 0.7, G = 0.7, B = 0.7). Thus, bright gray is finally converted to medium-brightness gray, ensuring that the method can still produce visually reasonable results in extreme cases, achieving the conversion from the first color space to the second color space, improving the detail visibility in dark areas, and greatly enhancing the accuracy and interpretability of data visualization.

[0086] Alternatively, when the value to be corrected is not within the color value range, determine the value range corresponding to the value to be corrected, and generate a correction ratio based on the value to be corrected and the value range corresponding to the value to be corrected through linear interpolation; determine the target value corresponding to the value to be corrected based on the correction ratio and the color value range. When the value to be corrected is within the color value range, generate the target value corresponding to the value to be corrected within the color value range through linear interpolation based on multiple values to be corrected and the color value range. For example, the second color value is (R = 0.3, G = 0.5, B = 0.2), the value range corresponding to the value to be corrected is [0, 1], the color value range is [0.5, 0.8], and the correction ratio of the first value to be corrected R = 0.3 in the value range corresponding to the value to be corrected is 0.3. Then the first target value is 0.3 * 0.5 + 0.5 = 0.65. Thus, the target values corresponding to the second value to be corrected and the third value to be corrected are obtained in sequence, which will not be elaborated here.

[0087] Step 1033, render the object to be displayed based on the target color value, and display the rendered object to be displayed; and / or, send the target color value corresponding to the object to be displayed in the second color space to a digital display device.

[0088] In the embodiments of the present disclosure, the electronic device may further convert the target color value into a target display code based on the color code in the second color space; render the object to be displayed through the target display code, and display the rendered object to be displayed. For example, according to the color code in the RGB color space, convert the target color value (R = 0.8000, G = 0.6875, B = 0.5000) into the target display code "CCAF80", and the electronic device may render the object to be displayed according to the target display code "CCAF80" and display the rendered object to be displayed.

[0089] Alternatively, the electronic device may also render the object to be displayed through the target color value, and send the rendered object to be displayed to a digital display device. The digital display device displays the rendered object to be displayed. For example, the electronic device first converts the target color value into a target display code based on the color code in the second color space. The target display code is "CCAF80", renders the object to be displayed according to the target display code "CCAF80", and sends the rendered object to be displayed to a digital display device.

[0090] Alternatively, the electronic device can also convert the target color value into a target display code, and send the target display code corresponding to the object to be displayed in the second color space to the digital display device. For example, the electronic device first converts the target color value into a target display code based on the color code in the second color space. The target display code is "CCAF80", and then sends the target display code "CCAF80" to the digital display device. The digital display device renders the object to be displayed through the target display code and displays the rendered object to be displayed.

[0091] Alternatively, the electronic device directly sends the target color value. The digital display device converts the target color value into a target display code based on the color code in the second color space, renders the object to be displayed through the target display code, and displays the rendered object to be displayed.

[0092] In some embodiments, Figure 3 is a schematic diagram of another color conversion method provided by an embodiment of the present disclosure. As Figure 3 shown, this method is implemented after the electronic device receives the RYB value (r, y, b). This method includes: Step 31, determining the color ring angle; Step 32, looking up the table / interpolating to obtain the RGB value; Step 33, adjusting the final brightness.

[0093] Among them, Step 31 includes: Step 311, normalizing the RYB value; Step 312, determining the primary color corresponding to the minimum value; Step 313, determining the color ring interval (red - yellow / yellow - blue / blue - red); Step 314, calculating the exact angular position (a value between 0 and 6). That is, the RYB value is normalized to obtain a normalized RYB value, so that the normalized RYB value conforms to the data processing format. The RYB value is composed of the values of the three primary colors. When there is a minimum value in the RYB value, the two primary colors other than the primary color corresponding to the minimum value are used as the main primary colors constituting the RYB value. From Figure 2 it can be seen that the two main primary colors can form an included angle on the color ring, obtaining the color ring interval corresponding to the normalized RYB value. Furthermore, the exact angular position can be calculated based on the ratio of the two main primary colors, and the value range of the exact angular position is greater than or equal to 0 and less than or equal to 6.

[0094] Step 32 includes: Step 321, determining the position of the angle in the reference table; Step 322, if the angle corresponds to an integer point: directly obtain the corresponding RGB value in the reference table; Step 323, if the angle corresponds to a non - integer point: find the two nearest points in the reference table and obtain the RGB value through linear interpolation. That is, the reference table includes the corresponding relationship between the integer value of the exact angular position x and the RGB value. As Figure 3As shown, when the value of x is any integer from 0 to 6, the corresponding RGB values are shown. When the value of the precise angular position is an integer, the corresponding RGB value can be directly obtained through the reference table. When the value of the precise angular position is not an integer, the corresponding RGB value can be calculated by linear interpolation.

[0095] In step 33, the final brightness adjustment of the RGB value is to simulate the effect of real paint mixing. In reality, when the RYB value is higher, the mixed color is darker; when the RYB value is lower, the mixed color is lighter. According to the characteristics of the RYB value in reality, based on the initially received RYB value (r, y, b), the RGB value is adjusted in brightness to obtain a color that is more in line with the artistic color mixing, making the final presentation of the color more in line with the color mixing result in people's reality.

[0096] In the embodiment of the present disclosure, the user inputs the RYB value into the electronic device, and the RYB value is (r = 0.3, y = 0.5, b = 0.2). The brightness value of the red primary color is 0.3, the brightness value of the yellow primary color is 0.5, and the brightness value of the blue primary color is 0.2.

[0097] In step 311, using the normalization theory, the RYB value is standardized, and the standardized RYB value is (r = 0.333, y = 1.000, b = 0.000); the minimum value is 0.000, and the primary color corresponding to the minimum value is the blue primary color, indicating that the two important primary colors constituting the standardized RYB value are the red primary color and the yellow primary color, and the color ring interval is the red - yellow interval. It is known that the threshold value corresponding to the red primary color on the color ring is 0, and the threshold value corresponding to the yellow primary color on the color ring is 2. The brightness ratio of the red primary color and the yellow primary color in the standardized RYB value is 1:3, that is, the standardized RYB value is composed of 1 part of the red primary color and 3 parts of the yellow primary color, and the precise angular position x of the standardized RYB value on the color ring is 1.5.

[0098] The precise angular position of the standardized RYB value on the color ring is the target color ring angle value. The x = 1.5 corresponds to a non - integer point. As shown in the color space conversion reference table in Table 1 above, it is determined that x = 1.5 is between 1 and 2. When the color ring angle value is 1, the corresponding conversion preset value is (R = 1, G = 0.5, B = 0); when the color ring angle value is 2, the corresponding conversion preset value is (R = 1, G = 0.75, B = 0); since x = 1.5 is exactly the mean of 1 and 2, using the linear interpolation theory, the mean values of the three colors in (R = 1, G = 0.5, B = 0) and (R = 1, G = 0.75, B = 0) are calculated respectively, and (R = 1, G = 0.625, B = 0) is obtained. The second color value is (R = 1, G = 0.625, B = 0).

[0099] Finally, the second color value (R = 1, G = 0.625, B = 0) is adjusted in brightness using the input RYB values (r = 0.3, y = 0.5, b = 0.2); in real life, the smaller the minimum value of the RYB values, the brighter the final color. The upper limit of the brightness adjustment calculated from the RYB values (r = 0.3, y = 0.5, b = 0.2) is 1 - min(RYB values) = 1 - 0.2 = 0.8. The larger the maximum value of the RYB values, the darker the final color, and the lower limit is 1 - max(RYB values) = 1 - 0.5 = 0.5. That is, the value ranges of the finally adjusted R, G, and B are [0.5, 0.8]. Since the values of R and B in the second color value are not within [0.5, 0.8], the minimum value B in the second color value is mapped to 0.5, and the maximum value R is mapped to 0.8, thus realizing the brightness adjustment of red and blue in the RGB color space. The adjusted B' = 0.5, R' = 0.8; and the value of G in the second color value is within [0.5, 0.8]. Using the linear interpolation theory, a linear function is constructed through the known R in the second color value and the corresponding R', and the known B in the second color value and the corresponding B'. Given the G in the second color value, the corresponding G' in the second color value is solved through the linear function, thus realizing the brightness adjustment of green in the RGB color space. The adjusted G' = 0.6875, and finally the adjusted target color value is (R = 0.8, G = 0.6875, B = 0.5).

[0100] In related technologies, the principle of color mixing is also applied in the field of gene technology. For example, single-cell RNA sequencing data is a type of biological data that records the gene activity levels of each individual cell in a biological sample. When analyzing single-cell RNA sequencing (scRNA-seq) data in bioinformatics, heatmaps (Heatmap) or dimensionality reduction visualizations (UMAP / t-SNE plots) are usually used to represent multi-dimensional gene expression data.

[0101] Heatmap: It can simultaneously display the expressions of multiple genes in multiple cells or cell populations, usually presented in matrix form. The rows represent genes, the columns represent cells or cell populations, and each value in the matrix represents the "expression level" or "activity level" of a specific gene in a specific cell.

[0102] Dimensionality reduction visualization (UMAP / t-SNE plot): Cells are displayed in a reduced-dimensional space, and each point represents a cell. Such plots have two main uses: a. Classification view: Different colors are used to represent classification information such as cell types or clustering results; b. Expression view: A color gradient is used to represent the expression level of a single gene, that is, the feature plot in the Seurat object. The Seurat object is a commonly used data structure in the R language, specifically for storing and processing single-cell RNA sequencing data.

[0103] However, representing multi-dimensional gene expression data using heatmaps or dimensionality reduction visualizations (UMAP / t-SNE plots) both face the same limitations. Under normal circumstances, each cell point can only be represented by one color in a single plot, and it is impossible to simultaneously display the expression of multiple genes. Researchers usually need to create multiple charts for side-by-side comparison, which increases the cognitive burden and makes pattern comparison difficult. Even when using the RGB color space for color representation and mixing, the RGB color space is the standard color space for digital displays. The mixed effects of multiple colors obtained based on the RGB color space are inconsistent with the mixed effects of multiple colors that researchers are accustomed to in real life, resulting in difficulties for researchers to interpret the color mixing based on the RGB color space. Moreover, yellow with too high brightness is difficult to identify on a white background, and blue with too low brightness is too dark when displayed. This leads to uneven visual weights for the expression intensities of different genes during multi-gene expression visualization, affecting the accurate interpretation of scientific data. For example, even when the expression levels are the same, genes marked in yellow will appear less obvious visually, while genes marked in blue may be overemphasized, resulting in poor color display effects.

[0104] In some embodiments, to facilitate researchers in obtaining better color display effects, where the object to be displayed includes cells, before step 101, there are also step 1001 and step 1002, where:

[0105] Step 1001: Obtain the expression standard values corresponding to N target genes in the cells respectively, and determine the primary colors corresponding to each target gene located in the first color space, where N is an integer greater than or equal to 1 and less than or equal to M, and M is the number of primary colors in the first color space, and the genes are located in the cells.

[0106] In the embodiments of the present disclosure, a cell refers to a cell point drawn by an electronic device or a cell image in an image. A target gene refers to a specific gene that needs to be studied. A cell may include one or more genes. Gene expression intensity refers to the degree of activity of a specific gene in a cell. A high gene expression intensity means that the gene is more active in the cell and produces more RNA molecules; a low gene expression intensity means that the gene is inactive or has low activity in the cell. The expression standard value refers to the value obtained after standardizing the gene expression intensity.

[0107] Normalizing gene expression intensity may include: for a target gene, obtaining the gene expression intensity corresponding to each cell among multiple cells; determining the maximum gene expression intensity and the minimum gene expression intensity based on the multiple gene expression intensities; and performing a normalization mapping process on each gene expression intensity based on the maximum gene expression intensity and the minimum gene expression intensity to generate multiple expression standard values. When performing the mapping, the corresponding standard value range of the expression standard value can also be limited. For example, the value range corresponding to the expression standard value is [0.1, 0.9], that is, the expression standard value is greater than or equal to 0.1 (low saturation) and less than or equal to 0.9 (high saturation), so that the expression standard value will only take values within the corresponding value range, making the distribution of the expression standard value more uniform and facilitating visualization.

[0108] In practice, when analyzing single-cell RNA sequencing (scRNA-seq) data in bioinformatics, it is usually to analyze the gene expression intensity of multiple cells, and the gene expression intensity can be a vector or a value extracted from a data frame, a list, or a subgraph. Of course, when the number of cells is 1, the gene expression intensity can be used as the expression standard value.

[0109] When the first color space is the RYB color space, M is equal to 3, and N is an integer greater than or equal to 1 and less than or equal to 3. For example, when N is equal to 3, the three target genes are feature.1, feature.2, and feature.3 respectively. The primary color corresponding to feature.1 is the red primary color, the primary color corresponding to feature.2 is the yellow primary color, and the primary color corresponding to feature.3 is the blue primary color. The primary color corresponding to the target gene can be adjusted manually or assigned by an electronic device. For any cell, obtain the gene expression intensity of feature.1 in the cell, as well as the maximum and minimum gene expression intensities corresponding to feature.1; generate a first gene expression intensity difference based on the maximum and minimum gene expression intensities corresponding to feature.1, and generate a second gene expression intensity difference based on the gene expression intensity of feature.1 in the cell and the minimum gene expression intensity corresponding to feature.1; generate a gene expression intensity ratio based on the ratio of the second gene expression intensity difference to the first gene expression intensity difference, and map the gene expression intensity ratio within the standard value range. When the gene expression intensity ratio takes any value in (0.9, 1], it is mapped to 0.9, and the expression standard value is 0.9, indicating that the target gene is highly expressed; when the gene expression intensity ratio takes any value in [0, 0.1), it is mapped to 0.1, and the expression standard value is 0.1, indicating that the target gene is lowly expressed; when the gene expression intensity ratio takes any value in [0.1, 0.9], the expression standard value is equal to the gene expression intensity ratio. Similarly, obtain the expression standard value of feature.2 in the cell and the expression standard value of feature.3 in the cell, so as to obtain the three expression standard values corresponding to the cell.

[0110] Step 1002: Generate a first color value corresponding to the cell based on the expression standard value and the primary color corresponding to the target gene.

[0111] In the embodiments of the present disclosure, for example, when N is equal to 3, the primary color corresponding to feature.1 is the red primary color, the primary color corresponding to feature.2 is the yellow primary color, and the primary color corresponding to feature.3 is the blue primary color; the expression standard value of feature.1 in the cell is 0.3, the expression standard value of feature.2 in the cell is 0.5, and the expression standard value of feature.3 in the cell is 0.2. Then, the first color value corresponding to the cell is (r = 0.3, y = 0.5, b = 0.2), where r represents the brightness of the red primary color, y represents the brightness of the yellow primary color, and b represents the brightness of the blue primary color.

[0112] When N is equal to 2, the two target genes are feature.1 and feature.2 respectively. The primary color corresponding to feature.1 is the red primary color, and the primary color corresponding to feature.2 is the yellow primary color. The obtained expression standard value of feature.1 in the cell is 0.3, and the obtained expression standard value of feature.2 in the cell is 0.2. Then, the first color value corresponding to the cell can be set as (r = 0.3, y = 0.5, b = 0.1). Or, when N is equal to 1, the target gene is feature.1, the primary color corresponding to feature.1 is the red primary color, and the expression standard value corresponding to feature.1 in the cell is 0.3. Then, the first color value corresponding to the cell is (r = 0.3, y = 0.1, b = 0.1).

[0113] Since the target gene corresponds to the primary color of the first color space and the target gene corresponds to the expression standard value, the expression standard value corresponds to the primary color of the first color space. The electronic device uses the expression standard value as the value of the primary color of the first color space, thereby converting the expression standard value in the field of gene technology into the primary color value in the first color space, and obtaining the values of the three primary colors corresponding to the cell in the first color space, which is convenient for subsequent color mixing and conversion. When the number of cells is multiple, the electronic device can repeatedly execute step 1001 to step 1002 to obtain the first color values corresponding to multiple cells respectively; or, the electronic device can also first execute step 1001 to obtain the expression standard values corresponding to multiple cells respectively, and the primary colors corresponding to the target genes in the first color space, and then execute step 1002 to obtain the first color values corresponding to multiple cells respectively.

[0114] In some embodiments, if the number of objects to be displayed is multiple, in step 1033, it includes: the electronic device renders the objects to be displayed based on the target color value; and displays the rendered objects to be displayed based on the cell sorting rule.

[0115] In the embodiments of the present disclosure, the target color value includes three target values. The target average value is obtained based on the three target values, and the target average value is used as the average expression intensity corresponding to the object to be displayed. The objects to be displayed include cells. When displaying the RNA sequencing data of multiple cells, since there may be overlapping situations among multiple cells, a cell sorting rule can be set. The cell sorting rule includes that the target color value corresponding to the cell with a higher average expression intensity is preferentially displayed to ensure that the cells with high expression are not blocked by the cells with low expression. And when displaying the target color value, the primary colors corresponding to each target gene, the colors obtained by mixing different primary colors, etc. can also be displayed. The content to be displayed is not limited herein. For example, the electronic device can adopt a unified cell layout and use the same cell coordinates and layout when displaying each sub-graph of the dimensionality reduction graph based on the specified dimensionality reduction method.

[0116] In some embodiments, Figure 4 is a flowchart of visualizing multi-dimensional features of single-cell RNA sequencing data provided by an embodiment of the present disclosure. As Figure 4 shown, it includes steps 41 to 48, where:

[0117] Step 41, data extraction and preparation: Extract the expression values of three genes corresponding to each of multiple cells from a Seurat object;

[0118] Step 42, expression value normalization: Map the expression values of each gene to a certain range (default 0.1 - 0.9);

[0119] Step 43, color mapping: Map the three genes to the primary colors RYB / primary colors RGB respectively. The first gene corresponds to red, the second gene corresponds to yellow / green, and the third gene corresponds to blue;

[0120] Step 44, color mixing: Determine that the selected color space is RYB or RGB according to the above color mapping;

[0121] Step 45, if the RYB color space (artistic mixing model) is selected, obtain the target color value corresponding to each cell based on the primary colors corresponding to the three genes in the cell and the normalized expression values corresponding to the three genes respectively, and execute step 47;

[0122] Step 46, if the RGB color space (linear mixing model) is selected, obtain the linear color value corresponding to each cell based on the primary colors corresponding to the three genes in the cell and the normalized expression values corresponding to the three genes respectively, and execute step 47;

[0123] Step 47, enable cell sorting rules: Specify that cells with higher expression intensity are drawn on the upper layer for priority display;

[0124] Step 48, visualization drawing: Draw the cells, draw the cells rendered with the target color value or linear color value on the dimensionality reduction graph, and display multiple cells according to the cell sorting rules.

[0125] In the embodiments of the present disclosure, first, an expression matrix is obtained. The rows of the expression matrix represent genes, the columns represent cells, and the values represent expression values. The number of genes can be thousands, and the number of cells can be thousands to tens of thousands. Of course, the number of genes or cells can be more or less. When the value of the expression value is relatively high, it indicates that the gene is highly active; when the value of the expression value is relatively low, it indicates that the gene is inactive.

[0126] Extract the expression values of three genes in cells from the expression matrix through a Seurat object; then normalize the expression values to map the gene expression values to a standard range, making the data more concentrated. Furthermore, the primary colors corresponding to the three genes can be set. When researchers are more accustomed to color mixing in reality, they can set "the first gene corresponds to red, the second gene corresponds to yellow, and the third gene corresponds to blue", indicating that the researchers have selected the art mixing model. The electronic device can obtain the target color value through the Figure 1 color conversion method shown, and then the user can set the electronic device to enable the cell sorting rule. Based on the cell sorting rule, the electronic device displays the dimensionality reduction map. In the dimensionality reduction map, the high-expression region of a single gene is the pure primary color region, the co-expression region of two genes is the mixed color region, and the co-expression region of three genes is the composite color or dark color region. If the user does not set the electronic device to enable the cell sorting rule, the electronic device directly displays the dimensionality reduction map, but the dimensionality reduction map without enabling the cell sorting rule has a poor performance when cells aggregate. Or, it can be set that "the first gene corresponds to red, the second gene corresponds to green, and the third gene corresponds to blue" to obtain the dimensionality reduction map based on the standard RGB mixing.

[0127] Moreover, researchers can compare the dimensionality reduction map obtained based on the standard RGB mixing with the dimensionality reduction map obtained based on the RYB mixing to determine the dimensionality reduction map that is more in line with cognition, facilitating the subsequent work. Thus, the expression conditions of three genes can be visually displayed simultaneously on a single dimensionality reduction map, enabling batch visualization of multiple gene combinations, exploring the expression patterns of multiple gene combinations simultaneously, and quickly identifying meaningful co-expression relationships; combining traditional art theory with modern computer science and bioinformatics creates a new data visualization paradigm with low computational overhead, capable of processing large-scale single-cell datasets, and applicable to conventional research equipment; directly reflecting the multi-gene co-expression pattern through color mixing, researchers can more easily identify cell subpopulations and transcriptome characteristics, accelerating biological discoveries and helping researchers comprehensively understand complex cell heterogeneity; when the number of target genes is multiple, it allows the expression conditions of multiple genes to be visually displayed simultaneously on a single dimensionality reduction map. Researchers can directly understand the relative expression levels of multiple genes by observing the mixed colors, reducing the need to switch between multiple charts, making single-cell RNA sequencing data analysis more intuitive and efficient, thereby accelerating the process of biomedical research. Compared with traditional methods, it reduces the number of charts, saves display space, and improves data interpretation efficiency; and the final color mixing effect is more in line with the cognition of researchers in real life. After brightness balancing of the colors, different colors have similar weights in visual performance, greatly improving the accuracy and interpretability of data visualization.

[0128] It should be noted that this color conversion method can also be applied to other scenarios that require visualizing one or more continuous variables simultaneously, such as spatial transcriptomics, multi-omics integration analysis, etc. Here, the scenarios to which this color conversion method can be applied are not limited.

[0129] An embodiment of the present disclosure provides a color conversion method. Based on the first color value of the object to be displayed in the first color space, a target color ring angle value corresponding to the first color value is determined, and the target color ring angle value is the angle corresponding to the first color value on the color ring. Through a color space conversion reference table, a second color value corresponding to the target color ring angle value in the second color space is determined. Based on the first color value, the second color value is corrected to generate and output the target color value of the object to be displayed in the second color space. Thus, first, the target color ring angle value corresponding to the first color value is determined on the color ring, and then through the target color ring angle value and the color space conversion reference table, the first color value in the first color space is converted into the second color value in the second color space, achieving precise conversion of colors in different spaces. The second color space is a color space commonly used in visualization. Furthermore, by correcting the second color value with the first color value, the display effect of the second color value is optimized, and a target color value with a better display effect is obtained. Finally, the target color value is output for display, facilitating users to view. And the color superposition in the first color space is more in line with the color superposition seen by people in real life. The first color value is converted into a displayable target color value, facilitating users' interpretation of the superimposed color. Correcting the second color value means balancing the brightness of the second color value, optimizing the brightness balance of colors in digital display. Moreover, this color conversion method can be applied in the field of gene technology, especially when displaying single-cell RNA sequencing data, facilitating researchers' interpretation of colors. After the brightness of the displayed colors is balanced, different colors have similar weights in visual performance, solving the problem that the weights of different colors vary too much, resulting in uneven visual weights for users, enabling researchers to interpret data more accurately.

[0130] Figure 5 It is a schematic structural diagram of a color conversion device provided by an embodiment of the present disclosure, as Figure 5 shown. The device includes: a first determination module 51, a second determination module 52, and an output module 53. The first determination module 51 is connected to the second determination module 52, and the second determination module 52 is connected to the output module 53.

[0131] The first determination module 51 is configured to determine a target color ring angle value corresponding to the first color value based on the first color value of the object to be displayed in the first color space, where the target color ring angle value is the angle corresponding to the first color value on the color ring; the second determination module 52 is configured to determine a second color value corresponding to the target color ring angle value in the second color space through a color space conversion reference table; the output module 53 is configured to correct the second color value based on the first color value, and generate and output a target color value corresponding to the object to be displayed in the second color space.

[0132] In some embodiments, the apparatus further includes: a third determination module 54 and a generation module 55. The third determination module 54 is connected to the generation module 55, and the generation module 55 is connected to the first determination module 51.

[0133] The third determination module 54 is configured to obtain expression standard values corresponding to N target genes in a cell respectively, and determine a primary color located in the first color space corresponding to each target gene, where N is an integer greater than or equal to 1 and less than or equal to M, and M is the number of primary colors in the first color space, and the gene is located in the cell; the generation module 55 is configured to generate a first color value corresponding to the cell based on the expression standard value and the primary color corresponding to the target gene.

[0134] In some embodiments, the first determination module 51 is configured to perform a normalization process on the first color value to generate a normalized color value; determine a target color ring range corresponding to the normalized color value on the color ring; generate a target color ring angle value based on the normalized color value and the target color ring range.

[0135] In some embodiments, the normalized color value includes a first standard primary color value, a second standard primary color value, and a third standard primary color value; the first determination module 51 is configured to determine a minimum standard primary color value based on the first standard primary color value, the second standard primary color value, and the third standard primary color value; determine the target color ring range based on the primary color corresponding to the minimum standard primary color value.

[0136] In some embodiments, the color space conversion reference table includes a correspondence between a color ring angle value and a conversion preset value; the second determination module 52 is configured to query whether the color space conversion reference table includes the target color ring angle value, and in the case where the color space conversion reference table includes the target color ring angle value, find a conversion preset value corresponding to the target color ring angle value from the color space conversion reference table; determine the second color value based on the conversion preset value corresponding to the target color ring angle value.

[0137] In some embodiments, the color space conversion reference table includes the correspondence between the color ring angle values and the conversion preset values; the second determination module 52 is configured to query whether the color space conversion reference table includes the target color ring angle value. When the color space conversion reference table does not include the target color ring angle value, find the adjacent color ring angle value corresponding to the target color ring angle value and the conversion preset value corresponding to the adjacent color ring angle value from the color space conversion reference table; and generate a second color value based on the conversion preset value corresponding to the adjacent color ring angle value, the adjacent color ring angle value, and the target color ring angle value through an interpolation algorithm.

[0138] In some embodiments, the output module 53 is configured to determine a color value range based on the first color value; correct the second color value based on the color value range to generate a target color value; render the object to be displayed based on the target color value, and display the rendered object to be displayed; and / or send the target color value corresponding to the object to be displayed in the second color space to a digital display device.

[0139] The present disclosure provides a color conversion device. The first determination module is configured to determine the target color ring angle value corresponding to the first color value based on the first color value corresponding to the object to be displayed in the first color space, where the target color ring angle value is the angle corresponding to the first color value on the color ring; the second determination module is configured to determine the second color value corresponding to the target color ring angle value in the second color space through a color space conversion reference table; the output module is configured to correct the second color value based on the first color value to generate and output the target color value corresponding to the object to be displayed in the second color space, so as to first determine the target color ring angle value corresponding to the first color value on the color ring, and then convert the first color value in the first color space into the second color value in the second color space through the target color ring angle value and the color space conversion reference table, realizing the accurate conversion of colors in different spaces; the second color space is the color space commonly used during visualization. Furthermore, the second color value is corrected based on the first color value to optimize the display effect of the second color value, obtaining a target color value with a better display effect, and finally outputting to display the target color value for the user to view conveniently.

[0140] Figure 6 It is a structural block diagram of an electronic device 600 provided by an embodiment of the present disclosure. For example, the electronic device 600 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.

[0141] Refer to Figure 6, the electronic device 600 may include one or more of the following components: a processing component 602, a memory 604, a power supply component 606, a multimedia component 608, an audio component 610, an input / output (I / O) interface 612, a sensor component 614, and a communication component 616.

[0142] The processing component 602 generally controls the overall operation of the electronic device 600, such as operations associated with at least one of display, telephone call, data communication, camera operation, and recording operation. The processing component 602 may include one or more processors 620 to execute instructions to complete all or part of the steps of the above methods. In addition, the processing component 602 may include one or more modules to facilitate the interaction between the processing component 602 and other components. For example, the processing component 602 may include a multimedia module to facilitate the interaction between the multimedia component 608 and the processing component 602.

[0143] The memory 604 is configured to store various types of data to support the operation on the electronic device 600. Examples of such data include at least one of the following: instructions for any application or method operating on the electronic device 600, contact data, phone book data, messages, pictures, and videos. The memory 604 may 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 memory, flash memory, a magnetic disk, or an optical disc.

[0144] The power supply component 606 provides power to various components of the electronic device 600. The power supply component 606 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 for the electronic device 600.

[0145] The multimedia component 608 includes a screen that provides an output interface between the electronic device 600 and the 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 can be implemented as a touch screen 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 can sense not only the boundaries of touch or swipe actions but also detect the duration and pressure associated with the touch or swipe operations. In some embodiments, the multimedia component 608 includes a front camera and / or a rear camera. When the electronic device 600 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera can receive external multimedia data. Each of the front camera and the rear camera can be a fixed optical lens system or have a focal length and optical zoom capabilities.

[0146] The audio component 610 is configured to output and / or input audio signals. For example, the audio component 610 includes a Microphone (MIC) that is configured to receive external audio signals when the electronic device 600 is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals can be further stored in the memory 604 or transmitted via the communication component 616. In some embodiments, the audio component 610 further includes a speaker for outputting audio signals.

[0147] The I / O interface 612 provides an interface between the processing component 602 and a peripheral interface module, which can be a keyboard, a click wheel, buttons, etc. These buttons can include but are not limited to: a home button, a volume button, a power button, and a lock button.

[0148] The sensor assembly 614 includes one or more sensors for providing status assessment in various aspects for the electronic device 600. For example, the sensor assembly 614 can detect the on / off state of the electronic device 600, the relative positioning of components, such as the display and keypad of the electronic device 600. The sensor assembly 614 can also detect a change in the position of the electronic device 600 or a component in the electronic device 600, the presence or absence of user contact with the electronic device 600, the orientation or acceleration / deceleration of the electronic device 600, and the temperature change of the electronic device 600. The sensor assembly 614 can include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 614 can also include a light sensor, such as a Complementary Metal Oxide Semiconductor (CMOS) or Charge Coupled Device (CCD) image sensor, for use in imaging applications. In some embodiments, the sensor assembly 614 can also include, but is not limited to, at least one of the following: an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, and a temperature sensor.

[0149] The communication component 616 is configured to facilitate communication between the electronic device 600 and other devices in a wired or wireless manner. The electronic device 600 can access a wireless network based on communication standards, such as Wi-Fi, 4G, 5G, or a combination thereof. In an exemplary embodiment, the communication component 616 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 616 further includes a Near Field Communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on Radio Frequency Identification (RFID) technology, Infrared Data Association (IrDA) technology, Ultra Wide Band (UWB) technology, Bluetooth (BT) technology, and other technologies.

[0150] In an exemplary embodiment, the electronic device 600 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.

[0151] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 604 including executable instructions or a computer program, and the above instructions or computer program can be executed by a processor 620 of the electronic device 600 to complete the above method. For example, the non-transitory computer-readable storage medium may be a ROM, a random access memory (RAM), a compact disc read-only memory (CD-ROM), magnetic tape, a floppy disk, and an optical data storage device, etc.

[0152] A non-transitory computer-readable storage medium, when the instructions in the storage medium are executed by a processor of an electronic device, enables the electronic device to execute any one of the above color conversion methods in the embodiments of the present disclosure. For example, the method includes: determining an angle of the first color value on a color wheel based on the first color value in a first color space to generate a target color wheel angle value; determining a value corresponding to the target color wheel angle value in a second color space through a color space conversion reference table to generate a second color value; and correcting the second color value based on the first color value to generate a target color value.

[0153] Those skilled in the art will readily conceive of other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. The present disclosure is intended to cover any variations, uses, or adaptations of the present disclosure, which follow the general principles of the present disclosure and include known common knowledge or conventional technical means in the technical field not disclosed by the present disclosure. The specification and the embodiments are only regarded as exemplary, and the true scope and spirit of the present disclosure are pointed out by the claims.

[0154] It should be understood that the present disclosure is not limited to the exact structures described above and shown in the drawings, and various modifications and changes can be made without departing from its scope. The scope of the present disclosure is limited only by the appended claims.

Claims

1. A color conversion method, characterized in that, Including: Based on a first color value corresponding to a to-be-displayed object in a first color space, determining a target color ring angle value corresponding to the first color value, where the target color ring angle value is an angle corresponding to the first color value on a color ring; Determining a second color value corresponding to the target color ring angle value in a second color space through a color space conversion reference table; Based on the first color value, correcting the second color value, and generating and outputting a target color value corresponding to the to-be-displayed object in the second color space.

2. The method according to claim 1, characterized in that, The to-be-displayed object includes cells. Before determining the target color ring angle value corresponding to the first color value based on the first color value corresponding to the to-be-displayed object in the first color space, it further includes: Obtaining expression standard values respectively corresponding to N target genes in the cells, and determining primary colors corresponding to each of the target genes and located in the first color space, where N is an integer greater than or equal to 1 and less than or equal to M, and M is the number of the primary colors in the first color space, and the genes are located in the cells; Generating the first color value corresponding to the cells based on the expression standard values and the primary colors corresponding to the target genes.

3. The method according to claim 1, wherein The determining the target color ring angle value corresponding to the first color value based on the first color value corresponding to the to-be-displayed object in the first color space includes: Performing a normalization process on the first color value to generate a normalized color value; Determining a target color ring range corresponding to the normalized color value on the color ring; Generating the target color ring angle value based on the normalized color value and the target color ring range.

4. The method according to claim 3, wherein The normalized color value includes a first standard primary color value, a second standard primary color value, and a third standard primary color value; The determining the target color ring range corresponding to the normalized color value on the color ring includes: Determining a standard primary color minimum value based on the first standard primary color value, the second standard primary color value, and the third standard primary color value; Determining the target color ring range based on the primary color corresponding to the standard primary color minimum value.

5. The method according to any one of claims 1 to 4, characterized in that The color space conversion reference table includes a corresponding relationship between color ring angle values and conversion preset values; The determining the second color value corresponding to the target color ring angle value in the second color space through the color space conversion reference table includes: Querying whether the color space conversion reference table includes the target color ring angle value. If the color space conversion reference table includes the target color ring angle value, searching for the conversion preset value corresponding to the target color ring angle value in the color space conversion reference table; Determining the second color value based on the conversion preset value corresponding to the target color ring angle value.

6. The method according to any one of claims 1 to 4, characterized in that, The color space conversion reference table includes a corresponding relationship between color ring angle values and conversion preset values; The determining the second color value corresponding to the target color ring angle value in the second color space through the color space conversion reference table includes: Query whether the color space conversion reference table includes the target color ring angle value. In the case where the color space conversion reference table does not include the target color ring angle value, look up the adjacent color ring angle value corresponding to the target color ring angle value and the conversion preset value corresponding to the adjacent color ring angle value from the color space conversion reference table; Generate the second color value based on the conversion preset value corresponding to the adjacent color ring angle value, the adjacent color ring angle value, and the target color ring angle value through an interpolation algorithm.

7. The method according to any one of claims 1 to 4, characterized in that The correcting the second color value based on the first color value to generate and output the target color value of the object to be displayed in the second color space includes: Determine the color value range based on the first color value; Correct the second color value based on the color value range to generate the target color value; Render the object to be displayed based on the target color value and display the rendered object to be displayed; and / or send the target color value of the object to be displayed in the second color space to a digital display device.

8. A color conversion device, characterized in that, Includes: A first determination module configured to determine a target color ring angle value corresponding to the first color value based on a first color value of an object to be displayed in a first color space, where the target color ring angle value is an angle corresponding to the first color value on the color ring; A second determination module configured to determine a second color value corresponding to the target color ring angle value in a second color space through a color space conversion reference table; An output module configured to correct the second color value based on the first color value and generate and output a target color value of the object to be displayed in the second color space.

9. An electronic device, characterized in that, Includes: 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 according to any one of claims 1 to 7.

10. A non - transitory computer - readable storage medium storing a computer program or instructions, characterized in that, When the computer programs or instructions in the storage medium are executed by the processor, the steps of the method according to any one of claims 1 to 7 are implemented.