WO2017166752A1 - 一种文字颜色设置方法、装置和电子设备 - Google Patents

一种文字颜色设置方法、装置和电子设备 Download PDF

Info

Publication number
WO2017166752A1
WO2017166752A1 PCT/CN2016/100250 CN2016100250W WO2017166752A1 WO 2017166752 A1 WO2017166752 A1 WO 2017166752A1 CN 2016100250 W CN2016100250 W CN 2016100250W WO 2017166752 A1 WO2017166752 A1 WO 2017166752A1
Authority
WO
WIPO (PCT)
Prior art keywords
color
background
text
similarity
reaches
Prior art date
Application number
PCT/CN2016/100250
Other languages
English (en)
French (fr)
Inventor
徐启坤
Original Assignee
乐视控股(北京)有限公司
乐视移动智能信息技术(北京)有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 乐视控股(北京)有限公司, 乐视移动智能信息技术(北京)有限公司 filed Critical 乐视控股(北京)有限公司
Publication of WO2017166752A1 publication Critical patent/WO2017166752A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces

Definitions

  • the present application relates to the field of intelligent terminal setting, and in particular, to a text color setting method, device, and electronic device.
  • the intelligent terminal has an independent operating system like a personal computer, an independent running space, and can be installed by a user to install a program provided by a third party service provider such as software, games, navigation, etc., and can realize a wireless network access terminal through a wireless network.
  • a third party service provider such as software, games, navigation, etc.
  • the general term The range of use of intelligent terminals has been spread all over the world. Intelligent terminals have excellent operating systems and are free to install various software. Users can save various data in the terminal and set the terminal according to their own needs.
  • the user can freely set the background and text display items of the visual operating system, wherein the background includes the desktop of the operating system main interface, the text can be the name of the application icon, and the system menu is selected. Items, visual clocks, etc., some operating systems can even intelligently transform the background of the terminal based on information such as time.
  • the color of the text is usually single, that is, all the visual characters will adopt a uniform color such as white or black; while the background is more complicated, because the background may be a user-provided image, the color may be very rich, which may cause The background color is too close to the text color, which may cause inconvenience to the user to recognize the text.
  • the text setting can be manually modified, and the text color is changed, thereby showing that the existing text color setting mode is less convenient.
  • the embodiment of the present application provides a text color setting method, including: acquiring a text color; acquiring a background color; determining whether the similarity between the background color and the text color reaches a preset similarity; When the similarity of the color of the text reaches the preset similarity, the color of the text is modified, and the similarity between the modified text color and the background color is lower than the preset similarity.
  • the acquiring a background color includes: acquiring a background image; analyzing a main color of the background image; comparing a main color of the background image with a predetermined threshold; The comparison of the primary color of the picture with a predetermined threshold determines the background color.
  • the analyzing the main color of the background image includes: determining a color of each pixel on the background image; and counting the number of pixels corresponding to the respective colors; The number of pixels corresponding to the respective colors determines a primary color.
  • the determining the background color according to the comparison result between the main color of the background image and a predetermined threshold comprises: when the main color of the background image is low At the predetermined threshold, the background color is determined to be a first color; when the primary color of the background image is higher than the predetermined threshold, the background color is determined to be the second color.
  • the text color is modified, and the modified text color is similar to the background color.
  • the degree is lower than the preset similarity, including: when the background color is the first color, and the similarity between the text color and the first color reaches a preset similarity, setting the text color to a second color; when the background color is the second color, and the similarity between the text color and the second color reaches a preset similarity, the text color is set to the first color.
  • the embodiment of the present application further provides a text color setting device, including: a text color obtaining unit, and a text color; a background color obtaining unit, configured to acquire a background color; and a similarity determining unit, configured to determine the background color Whether the similarity of the color of the text reaches the preset similarity; the text color setting unit is configured to modify the color of the text, the color of the modified text, and when the similarity between the background color and the text color reaches a preset similarity The similarity of the background color is lower than the preset similarity.
  • the background color obtaining unit includes: a picture acquiring unit, configured to acquire a background image; a main color analyzing unit, configured to analyze a main color of the background image; and a comparison unit, And a background color determining unit configured to determine a background color according to a comparison result between the main color of the background image and a predetermined threshold.
  • the primary color analysis unit includes: a pixel point color recognition unit, configured to determine a color of each pixel on the background image; a pixel point The color statistic unit is configured to count the number of pixels corresponding to the respective colors, and the main color determining unit is configured to determine a main color according to the number of the pixel points corresponding to the various colors.
  • the background color determining unit includes: a first color determining unit, configured to determine a background color when the main color of the background image is lower than the predetermined threshold a color; a second color determining unit, configured to determine the background color as the second color when the main color of the background image is higher than the predetermined threshold.
  • the text color setting unit includes: a first color setting unit, configured to: when the background color is a first color, and the text color and the first color When the similarity reaches the preset similarity, the text color is set to the second color; the second color setting unit is configured to: when the background color is the second color, and the text color and the second color When the similarity reaches the preset similarity, the text color is set to the first color.
  • An embodiment of the present application further provides an electronic device including at least one processor; and a memory communicably coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor The instruction is executed by the at least one processor to enable the at least one processor to: acquire a text color; obtain a background color; and determine whether the similarity between the background color and the text color reaches a preset similarity; When the similarity between the background color and the text color reaches a preset similarity, the text color is modified, and the similarity between the modified text color and the background color is lower than the preset similarity.
  • the electronic device preferentially obtains the background color, including: acquiring a background image; analyzing a main color of the background image; comparing a main color of the background image with a predetermined threshold; The background color of the background image is compared with a predetermined threshold to determine the background colour.
  • the analyzing the main color of the background image includes: determining a color of each pixel on the background image; and counting the number of pixels corresponding to the respective colors; The number of pixels corresponding to the respective colors determines a primary color.
  • the electronic device preferentially determines the background color according to the comparison result between the main color of the background image and a predetermined threshold, including: when the main color of the background image is lower than the predetermined threshold The background color is determined to be the first color; when the main color of the background image is higher than the predetermined threshold, the background color is determined to be the second color.
  • the text color, the modified text color, and the background color are modified.
  • the similarity is lower than the preset similarity, including: when the background color is the first color, and the similarity between the text color and the first color reaches a preset similarity, the text color is set And being the second color; when the background color is the second color, and the similarity between the text color and the second color reaches a preset similarity, the text color is set as the first color.
  • the embodiment of the present application further provides a non-volatile computer storage medium, the storage medium storing the computer-executable instructions of the computer-executable instructions, when executed by the electronic device, enabling the electronic device to: acquire a text color; Obtaining a background color; determining whether the similarity between the background color and the text color reaches a preset similarity; and when the similarity between the background color and the text color reaches a preset similarity, modifying the text color, the modified text
  • the similarity of the color to the background color is lower than the preset similarity.
  • the storage medium of the embodiment of the present application preferentially acquires the background color, including: Obtaining a background image; analyzing a main color of the background image; comparing a main color of the background image with a predetermined threshold; determining a background color according to a comparison result between a main color of the background image and a predetermined threshold.
  • the analyzing the main color of the background image includes: determining a color of each pixel on the background image; and counting the number of pixels corresponding to the respective colors; The number of pixels corresponding to the respective colors determines a primary color.
  • the background color is determined according to the comparison result between the main color of the background image and a predetermined threshold, including: when the main color of the background image is lower than the predetermined threshold The background color is determined to be the first color; when the main color of the background image is higher than the predetermined threshold, the background color is determined to be the second color.
  • the text color, the modified text color, and the background color are modified.
  • the similarity is lower than the preset similarity, including: when the background color is the first color, and the similarity between the text color and the first color reaches a preset similarity, the text color is set And being the second color; when the background color is the second color, and the similarity between the text color and the second color reaches a preset similarity, the text color is set as the first color.
  • the embodiment of the present application further provides a computer program product, the computer program product comprising a computer program stored on a non-transitory computer readable storage medium, the computer program comprising program instructions, when the program instructions are executed by a computer When the computer is caused to perform any of the above methods.
  • the text color setting method, device, and electronic device and storage medium provided by the present application, Obtain the text color and the background color, and analyze whether the similarity between the two reaches the preset similarity.
  • the similarity is high, the color of the text is automatically modified, and the similarity between the modified text color and the background color is low.
  • the application can trigger the execution when the user or the operating system changes the background, and automatically set the text color according to the background color, without having to wait for the user to find the manual difficulty to set manually, the application has strong Convenience.
  • FIG. 1 is a flowchart of a method for setting a text color according to an embodiment of the present application
  • FIG. 2 is a schematic structural diagram of a text color setting apparatus according to an embodiment of the present application.
  • FIG. 3 is a schematic structural diagram of hardware of an electronic device according to an embodiment of the present disclosure.
  • connection or integral connection; may be mechanical connection or electrical connection; may be directly connected, may also be indirectly connected through an intermediate medium, or may be internal communication of two components, may be wireless connection, or may be wired connection.
  • connection or integral connection; may be mechanical connection or electrical connection; may be directly connected, may also be indirectly connected through an intermediate medium, or may be internal communication of two components, may be wireless connection, or may be wired connection.
  • the embodiment of the present application provides a text color setting method.
  • the method can be executed in an intelligent terminal such as a smart phone or a tablet computer.
  • the condition for triggering the method may be monitoring when the desktop is replaced, or setting the desktop background for the first time.
  • the method includes the following steps:
  • the text color is obtained. Since all the text colors in the operating system are generally unified, the acquisition manners can be various. For example, the system setting file can be directly read to obtain the text setting item, and the current text color can be known. The text color is white;
  • the background color is obtained, and the obtaining manner is various.
  • some operating systems provide an external interface, and the current background color can be known through the interface.
  • the operating system will also provide a color (this color is preset), this method can directly identify the read color as the background color; if the image is provided by the user, and the color is more complicated , you need to analyze the picture to get a main color as the background color.
  • the specific analysis scheme will be described in detail below. For example, after analyzing a color picture in this step, the determined background color is white.
  • Step S3 determining whether the similarity between the background color and the text color reaches a preset similarity, for example, determining whether color data such as RGB values of the two are similar or identical, when the similarity between the background color and the text color reaches a preset similarity Step S4 is performed, otherwise no operation may be performed.
  • modifying the color of the text, the similarity between the modified text color and the background color is lower than the preset similarity, and the modified color may be predetermined or determined according to the background color, for example, Change the text to a black, yellow, red, etc. color that is less similar to white.
  • the text color and the background color are acquired, and whether the similarity between the two reaches the preset similarity, and when the similarity is high, the color of the text is automatically modified and modified.
  • the similarity between the text color and the background color is lower than the preset similarity.
  • the application can trigger the execution when the user or the operating system changes the background, and automatically set the text color according to the background color, without waiting for the user to find the identification difficulty.
  • the setting is performed manually, and the application has strong convenience.
  • step S2 may include:
  • S24 Determine a background color according to a comparison result between the main color of the background image and a predetermined threshold. Specifically, if it is directly determined as the background color, it may be disadvantageous for subsequent determination of its similarity with the color of the text. Therefore, the scheme uses a threshold to determine it, and determines the background color as a color with high recognition. This will improve the efficiency of subsequent operations.
  • step S22 may include the following steps:
  • S221 Determine a color of each pixel on the background image. Specifically, an array of pixel point color values may be constructed, and each element in the array is a color value of one pixel.
  • determining a main color according to the number of pixels corresponding to the various colors for example, a pixel having a color value of a1.b1.c1 has X1... a pixel having an a value of an.bn.cn has Xn Therefore, the color value corresponding to the most number of pixel points can be determined as the main color value, or the average value of the color value corresponding to the number of pixels corresponding to the number of pixels can be calculated as the main color value.
  • the above step S24 may include:
  • the scheme only reserves two background colors, for example, it can be black (RGB is 0.0.0) and white (RGB is 255.255.255), and then it is judged by a predetermined threshold whether the main color is closer to black or white, and then the background color is determined as Black or white to improve the efficiency of subsequent operations.
  • the above step S4 may include:
  • the background color is the first color
  • the similarity between the text color and the first color reaches a preset similarity
  • set the text color to a second color for example, when the background color is determined.
  • the text color is set to white.
  • the text color is set as the first color.
  • the background color is judged to be white, and the text color is white, the text color is set to black. Therefore, the solution only needs to switch between the two colors, and it is not necessary to calculate a complicated chromatic aberration, thereby improving the efficiency of the setting operation.
  • the embodiment of the present application provides a text color setting device. As shown in FIG. 2, the device includes:
  • a background color obtaining unit 22 configured to acquire a background color
  • the similarity determining unit 23 is configured to determine whether the similarity between the background color and the text color reaches a preset similarity
  • a text color setting unit 24 configured to modify the text color, the modified text color, and the background color when the similarity between the background color and the text color reaches a preset similarity The similarity is lower than the preset similarity.
  • the text color setting device provided by the present application, the text color and the background color are acquired, and whether the similarity between the two reaches the preset similarity, and when the similarity is high, the color of the text is automatically modified and modified.
  • the similarity between the text color and the background color is lower than the preset similarity.
  • the application can trigger the execution when the user or the operating system changes the background, and automatically set the text color according to the background color, without waiting for the user to find the identification difficulty.
  • the setting is performed manually, and the application has strong convenience.
  • the background color obtaining unit comprises:
  • a picture acquisition unit for acquiring a background image
  • a main color analysis unit configured to analyze a main color of the background image
  • a comparison unit configured to compare a primary color of the background image with a predetermined threshold
  • a background color determining unit configured to determine a background color according to a comparison result between the main color of the background image and a predetermined threshold.
  • the primary color analysis unit comprises:
  • a pixel color recognition unit configured to determine a color of each pixel on the background image
  • a pixel color statistics unit for counting the number of pixels corresponding to each color
  • the main color determining unit is configured to determine a main color according to the number of pixel points corresponding to the various colors.
  • the background color determining unit comprises:
  • a first color determining unit configured to determine a background color as the first color when a primary color of the background image is lower than the predetermined threshold
  • a second color determining unit configured to: when a primary color of the background image is higher than the predetermined threshold When the background color is determined as the second color.
  • the text color setting unit comprises:
  • a first color setting unit configured to set the text color to a second color when the background color is a first color, and the similarity between the text color and the first color reaches a preset similarity
  • a second color setting unit configured to set the text color as the first color when the background color is the second color, and the similarity between the text color and the second color reaches a preset similarity.
  • the present application also provides an electronic device, as shown in FIG. 3, including at least one processor 810; and a memory 800 communicably coupled to the at least one processor 810; wherein the memory 800 stores Executing instructions executed by at least one processor 810, the instructions being executed by the at least one processor 810 to enable the at least one processor 810 to: acquire text color; obtain a background color; determine the background color and text color Whether the degree of similarity reaches a preset similarity; when the similarity between the background color and the text color reaches a preset similarity, the text color is modified, and the similarity between the modified text color and the background color is lower than Preset the similarity.
  • the electronic device also includes an input device 830 and an output device 840 that are electrically coupled to the memory 800 and the processor, the electrical connections preferably being connected by a bus.
  • the acquiring a background color includes: acquiring a background image; analyzing a main color of the background image; comparing a main color of the background image with a predetermined threshold; according to the background The comparison of the primary color of the picture with a predetermined threshold determines the background color.
  • the electronic device of this embodiment preferably, the main color of the analysis background image, the package Included: determining a color of each pixel on the background image; counting the number of pixels corresponding to the respective colors; determining a primary color according to the number of pixels corresponding to the respective colors.
  • the determining, according to a comparison result between the main color of the background image and a predetermined threshold, a background color including: when a main color of the background image is lower than the predetermined threshold Determining a background color as a first color; and determining a background color as a second color when a primary color of the background image is above the predetermined threshold.
  • the text color is modified, and the modified text color is similar to the background color.
  • the degree is lower than the preset similarity, including: when the background color is the first color, and the similarity between the text color and the first color reaches a preset similarity, setting the text color to a second color; when the background color is the second color, and the similarity between the text color and the second color reaches a preset similarity, the text color is set to the first color.
  • the embodiment of the present application further provides a non-volatile computer storage medium, the storage medium storing the computer-executable instructions of the computer-executable instructions, when executed by the electronic device, enabling the electronic device to: acquire a text color; Obtaining a background color; determining whether the similarity between the background color and the text color reaches a preset similarity; and when the similarity between the background color and the text color reaches a preset similarity, modifying the text color, the modified text
  • the similarity of the color to the background color is lower than the preset similarity.
  • the acquiring a background color includes: acquiring a background image; analyzing a main color of the background image; comparing a main color of the background image with a pre- Determining a threshold; determining a background color according to a comparison result of a primary color of the background image and a predetermined threshold.
  • the analyzing the main color of the background image comprises: determining a color of each pixel on the background image; and counting the number of pixels corresponding to the respective colors; The number of pixels corresponding to the respective colors determines a primary color.
  • the determining the background color according to the comparison result between the main color of the background image and a predetermined threshold including: when the main color of the background image is lower than the predetermined threshold Determining a background color as a first color; and determining a background color as a second color when a primary color of the background image is above the predetermined threshold.
  • the text color is modified, and the modified text color is similar to the background color.
  • the degree is lower than the preset similarity, including: when the background color is the first color, and the similarity between the text color and the first color reaches a preset similarity, setting the text color to a second color; when the background color is the second color, and the similarity between the text color and the second color reaches a preset similarity, the text color is set to the first color.
  • the embodiment of the present application further provides a computer program product, the computer program product comprising a computer program stored on a non-transitory computer readable storage medium, the computer program comprising program instructions, wherein when the program When the instructions are executed by the computer, the computer is caused to perform any of the methods described above.
  • embodiments of the present application can be provided as a method, a system, Or a computer program product.
  • the present application can take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment in combination of software and hardware.
  • the application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) including computer usable program code.
  • the computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture comprising the instruction device.
  • the apparatus implements the functions specified in one or more blocks of a flow or a flow and/or block diagram of the flowchart.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Character Input (AREA)
  • Image Analysis (AREA)
  • Processing Or Creating Images (AREA)

Abstract

一种文字颜色设置方法、装置和电子设备,涉及智能终端设置领域,所述方法包括:获取文字颜色(S1);获取背景颜色(S2);判断所述背景颜色和文字颜色的相似度是否达到预设相似度(S3);当所述背景颜色和文字颜色的相似度达到预设相似度时,修改所述文字颜色(S4),修改后的文字颜色与所述背景颜色的相似度低于所述预设相似度。可以在用户或操作系统更换背景时触发执行,实现根据背景颜色自动地对文字颜色进行设置,而不必等到用户发现辨识困难时手动进行设置,具有较强的便利性。

Description

一种文字颜色设置方法、装置和电子设备
交叉引用
本申请为在2016年04月01日提交中国专利局、申请号为201610203274.X、发明名称为“一种文字颜色设置方法及装置”的中国专利申请的继续申请,本申请要求在2016年04月01日提交中国专利局、申请号为201610203274.X、发明名称为“一种文字颜色设置方法及装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及智能终端设置领域,具体涉及一种文字颜色设置方法、装置和电子设备。
背景技术
智能终端是像个人电脑一样具有独立的操作系统,独立的运行空间,可以由用户自行安装软件、游戏、导航等第三方服务商提供的程序,并可以通过无线网络来实现无线网络接入的终端的总称。智能终端的使用范围已经布满全世界,智能终端具有优秀的操作系统、可自由安装各类软件等特性,用户可以在终端中保存各种数据,并且可以根据自身需求对终端进行设置。
用户可以自由设置可视化操作系统的背景和文字显示项,其中背景包括操作系统主界面的桌面,文字可以是应用程序图标的名称、系统菜单选 项、可视化时钟等,某些操作系统甚至可以根据时间等信息智能变换终端的背景。文字的颜色通常是单一的,即所有可视化文字均会采用统一的颜色如白色或黑色;而背景的情况比较复杂,由于背景可能是用户提供的图片,其颜色可能非常丰富,这就有可能造成背景颜色与文字颜色过于接近,由此会给用户辨识文字带来不便。当用户发现无法清楚辨识文字时,只能手动修改文字设置,改变文字颜色,由此可见现有的文字颜色设置方式便利性较差。
发明内容
本申请要解决的是现有的文字颜色设置方式便利性较差的问题。
有鉴于此,本申请实施例提供了一种文字颜色设置方法,包括:获取文字颜色;获取背景颜色;判断所述背景颜色和文字颜色的相似度是否达到预设相似度;当所述背景颜色和文字颜色的相似度达到预设相似度时,修改所述文字颜色,修改后的文字颜色与所述背景颜色的相似度低于所述预设相似度。
本申请实施例所述的方法,优选地,所述获取背景颜色,包括:获取背景图片;分析所述背景图片的主颜色;比对所述背景图片的主颜色与预定阈值;根据所述背景图片的主颜色与预定阈值的比对结果确定背景颜色。
本申请实施例所述的方法,优选地,所述分析背景图片的主颜色,包括:确定所述背景图片上的每个像素点的颜色;统计各种颜色对应的像素点的数量;根据所述各种颜色对应的像素点的数量确定一个主颜色。
本申请实施例所述的方法,优选地,所述根据所述背景图片的主颜色与预定阈值的比对结果确定背景颜色,包括:当所述背景图片的主颜色低 于所述预定阈值时,将背景颜色确定为第一颜色;当所述背景图片的主颜色高于所述预定阈值时,将背景颜色确定为第二颜色。
本申请实施例所述的方法,优选地,所述当所述背景颜色和文字颜色的相似度达到预设相似度时,修改所述文字颜色,修改后的文字颜色与所述背景颜色的相似度低于所述预设相似度,包括:当所述背景颜色为第一颜色,且所述文字颜色与所述第一颜色的相似度达到预设相似度时,将所述文字颜色设置为第二颜色;当所述背景颜色为第二颜色,且所述文字颜色与所述第二颜色的相似度达到预设相似度时,将所述文字颜色设置为第一颜色。
相应地,本申请实施例还提供一种文字颜色设置装置,包括:文字颜色获取单元,和文字颜色;背景颜色获取单元,用于获取背景颜色;相似度判断单元,用于判断所述背景颜色和文字颜色的相似度是否达到预设相似度;文字颜色设置单元,用于当所述背景颜色和文字颜色的相似度达到预设相似度时,修改所述文字颜色,修改后的文字颜色与所述背景颜色的相似度低于所述预设相似度。
本申请实施例所述的装置,优选地,所述背景颜色获取单元包括:图片获取单元,用于获取背景图片;主颜色分析单元,用于分析所述背景图片的主颜色;比对单元,用于比对所述背景图片的主颜色与预定阈值;背景颜色确定单元,用于根据所述背景图片的主颜色与预定阈值的比对结果确定背景颜色。
本申请实施例所述的装置,优选地,所述主颜色分析单元包括:像素点颜色识别单元,用于确定所述背景图片上的每个像素点的颜色;像素点 颜色统计单元,用于统计各种颜色对应的像素点的数量;主颜色确定单元,用于根据所述各种颜色对应的像素点的数量确定一个主颜色。
本申请实施例所述的装置,优选地,所述背景颜色确定单元包括:第一颜色确定单元,用于当所述背景图片的主颜色低于所述预定阈值时,将背景颜色确定为第一颜色;第二颜色确定单元,用于当所述背景图片的主颜色高于所述预定阈值时,将背景颜色确定为第二颜色。
本申请实施例所述的装置,优选地,所述文字颜色设置单元包括:第一颜色设置单元,用于当所述背景颜色为第一颜色,且所述文字颜色与所述第一颜色的相似度达到预设相似度时,将所述文字颜色设置为第二颜色;第二颜色设置单元,用于当所述背景颜色为第二颜色,且所述文字颜色与所述第二颜色的相似度达到预设相似度时,将所述文字颜色设置为第一颜色。
本申请实施例还提供了一种电子设备,包括至少一个处理器;以及,与所述至少一个处理器通信连接的存储器;其中,所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器能够:获取文字颜色;获取背景颜色;判断所述背景颜色和文字颜色的相似度是否达到预设相似度;当所述背景颜色和文字颜色的相似度达到预设相似度时,修改所述文字颜色,修改后的文字颜色与所述背景颜色的相似度低于所述预设相似度。
本申请实施例所述的电子设备,优先地,所述获取背景颜色,包括:获取背景图片;分析所述背景图片的主颜色;比对所述背景图片的主颜色与预定阈值;根据所述背景图片的主颜色与预定阈值的比对结果确定背景 颜色。
本申请实施例所述的电子设备,优先地,所述分析背景图片的主颜色,包括:确定所述背景图片上的每个像素点的颜色;统计各种颜色对应的像素点的数量;根据所述各种颜色对应的像素点的数量确定一个主颜色。
本申请实施例所述的电子设备,优先地,所述根据所述背景图片的主颜色与预定阈值的比对结果确定背景颜色,包括:当所述背景图片的主颜色低于所述预定阈值时,将背景颜色确定为第一颜色;当所述背景图片的主颜色高于所述预定阈值时,将背景颜色确定为第二颜色。
本申请实施例所述的电子设备,优先地,所述当所述背景颜色和文字颜色的相似度达到预设相似度时,修改所述文字颜色,修改后的文字颜色与所述背景颜色的相似度低于所述预设相似度,包括:当所述背景颜色为第一颜色,且所述文字颜色与所述第一颜色的相似度达到预设相似度时,将所述文字颜色设置为第二颜色;当所述背景颜色为第二颜色,且所述文字颜色与所述第二颜色的相似度达到预设相似度时,将所述文字颜色设置为第一颜色。
本申请实施例还提供了一种非易失性计算机存储介质,所述存储介质存储有计算机可执行指令的所述计算机可执行指令,当由电子设备执行时使得电子设备能够:获取文字颜色;获取背景颜色;判断所述背景颜色和文字颜色的相似度是否达到预设相似度;当所述背景颜色和文字颜色的相似度达到预设相似度时,修改所述文字颜色,修改后的文字颜色与所述背景颜色的相似度低于所述预设相似度。
本申请实施例所述的存储介质,优先地,所述获取背景颜色,包括: 获取背景图片;分析所述背景图片的主颜色;比对所述背景图片的主颜色与预定阈值;根据所述背景图片的主颜色与预定阈值的比对结果确定背景颜色。
本申请实施例所述的存储介质,优先地,所述分析背景图片的主颜色,包括:确定所述背景图片上的每个像素点的颜色;统计各种颜色对应的像素点的数量;根据所述各种颜色对应的像素点的数量确定一个主颜色。
本申请实施例所述的存储介质,优先地,所述根据所述背景图片的主颜色与预定阈值的比对结果确定背景颜色,包括:当所述背景图片的主颜色低于所述预定阈值时,将背景颜色确定为第一颜色;当所述背景图片的主颜色高于所述预定阈值时,将背景颜色确定为第二颜色。
本申请实施例所述的存储介质,优先地,所述当所述背景颜色和文字颜色的相似度达到预设相似度时,修改所述文字颜色,修改后的文字颜色与所述背景颜色的相似度低于所述预设相似度,包括:当所述背景颜色为第一颜色,且所述文字颜色与所述第一颜色的相似度达到预设相似度时,将所述文字颜色设置为第二颜色;当所述背景颜色为第二颜色,且所述文字颜色与所述第二颜色的相似度达到预设相似度时,将所述文字颜色设置为第一颜色。
本申请实施例还提供了一种计算机程序产品,所述计算机程序产品包括存储在非暂态计算机可读存储介质上的计算机程序,所述计算机程序包括程序指令,当所述程序指令被计算机执行时,使所述计算机执行上述任一方法。
根据本申请提供的文字颜色设置方法、装置和电子设备及存储介质, 对文字颜色和背景颜色进行获取,并分析二者的相似度是否达到预设相似度,当相似度较高时,自动修改文字的颜色,并使修改后的文字颜色与背景颜色的相似度低于预设相似度,本申请可以在用户或操作系统更换背景时触发执行,实现根据背景颜色自动地对文字颜色进行设置,而不必等到用户发现辨识困难时手动进行设置,本申请具有较强的便利性。
附图说明
为了更清楚地说明本申请具体实施方式或现有技术中的技术方案,下面将对具体实施方式或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图是本申请的一些实施方式,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1为本申请实施例提供的文字颜色设置方法的流程图;
图2为本申请实施例提供的文字颜色设置装置的结构示意图;
图3为本申请实施例提供的电子设备的硬件结构示意图。
具体实施方式
下面将结合附图对本申请的技术方案进行清楚、完整地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
在本申请的描述中,需要说明的是,术语“中心”、“上”、“下”、“左”、“右”、“竖直”、“水平”、“内”、“外”等指示的方位或位置关系为基于附图所示的方位或位置关系,仅是为了便于描述本申请和简化描述,而不是指示或暗示所指的装置或元件必须具有特定的方位、以特定的方位构造和操作,因此不能理解为对本申请的限制。此外,术语“第一”、“第二”、“第三”仅用于描述目的,而不能理解为指示或暗示相对重要性。
在本申请的描述中,需要说明的是,除非另有明确的规定和限定,术语“安装”、“相连”、“连接”应做广义理解,例如,可以是固定连接,也可以是可拆卸连接,或一体地连接;可以是机械连接,也可以是电连接;可以是直接相连,也可以通过中间媒介间接相连,还可以是两个元件内部的连通,可以是无线连接,也可以是有线连接。对于本领域的普通技术人员而言,可以具体情况理解上述术语在本申请中的具体含义。
此外,下面所描述的本申请不同实施方式中所涉及的技术特征只要彼此之间未构成冲突就可以相互结合。
实施例1
本申请实施例提供了一种文字颜色设置方法,本方法可以在如智能手机、平板电脑等智能终端中执行,触发本方法的条件可以是监测到桌面被更换的时候,或者是首次设置桌面背景的时候,如图1所示,该方法包括如下步骤:
S1,获取文字颜色,由于操作系统中所有的文字颜色通常是统一的,其获取方式可以有多种,例如可以直接读取系统设置文件得到文字设置项即可得知当前的文字颜色,假设当前文字颜色为白色;
S2,获取背景颜色,获取方式有多种,例如某些操作系统提供对外的接口,通过该接口即可得知当前的背景颜色,具体地,如果图片是操作系统内置的,即使背景是彩色的(含有多种颜色),操作系统也会提供一个颜色(该颜色是预设的),本方法可直接将读取到的颜色认定为背景颜色;如果图片是用户提供的,且颜色情况比较复杂,则需要对图片进行分析得到一个主颜色作为背景颜色,具体分析方案将在下文进行详细介绍。例如本步骤对一个彩色图片进行分析后,确定的背景颜色为白色。
S3,判断所述背景颜色和文字颜色的相似度是否达到预设相似度,例如判断二者的RGB值等颜色数据是否相近或相同,当所述背景颜色和文字颜色的相似度达到预设相似度时,执行步骤S4,否则可以不执行任何操作。
S4,修改所述文字颜色,修改后的文字颜色与所述背景颜色的相似度低于所述预设相似度,修改后的颜色可以是预定的,也可以是根据背景颜色确定的,例如可以将文字修改为黑色、黄色、红色等与白色的相似度较低的颜色。
根据本申请提供的文字颜色设置方法,对文字颜色和背景颜色进行获取,并分析二者的相似度是否达到预设相似度,当相似度较高时,自动修改文字的颜色,并使修改后的文字颜色与背景颜色的相似度低于预设相似度,本申请可以在用户或操作系统更换背景时触发执行,实现根据背景颜色自动地对文字颜色进行设置,而不必等到用户发现辨识困难时手动进行设置,本申请具有较强的便利性。
作为一个优选的实施方式,上述步骤S2可以包括:
S21,获取背景图片,例如可以读取背景配置信息,然后确定背景图片 的存储位置进而读取图片文件;
S22,分析所述背景图片的主颜色,其中主颜色可以是该图片中出现最多的颜色,也可以是根据该图片中使用的颜色计算出的一个主颜色;
S23,比对所述背景图片的主颜色与预定阈值;
S24,根据所述背景图片的主颜色与预定阈值的比对结果确定背景颜色。具体地,如果直接将其判定为背景颜色,可能不利于后续确定其与文字颜色的相似度,因此本方案利用一个阈值对其进行判定,将背景颜色确定为一个具有高辨识度的颜色,由此来提高后续操作的效率。
进一步地,上述步骤S22可以包括如下步骤:
S221,确定所述背景图片上的每个像素点的颜色,具体地,可以构造像素点颜色值的数组,数组中的每个元素是一个像素点的颜色值。
S222,统计各种颜色对应的像素点的数量。对数组中的所有颜色值进行一次排序,确定颜色的种类,给出了每种颜色所占的比例/个数。
S223,根据所述各种颜色对应的像素点的数量确定一个主颜色,例如,色值为a1.b1.c1的像素点有X1个……色值为an.bn.cn的像素点有Xn个,由此可以将数量最多的像素点对应的色值定为主色值,或者也可以计算数量大于一定数量的像素点对应的色值的平均值作为主色值。
上述步骤S24可以包括:
S241,当所述背景图片的主颜色低于所述预定阈值时,将背景颜色确定为第一颜色;
S242,当所述背景图片的主颜色高于所述预定阈值时,将背景颜色确定为第二颜色。
本方案只预定两种背景颜色,例如可以是黑色(RGB为0.0.0)和白色(RGB为255.255.255),然后通过预定阈值判断上述主颜色更接近黑色还是白色,然后将背景颜色判定为黑色或者白色,以提高后续操作的效率。
上述步骤S4可以包括:
S41,当所述背景颜色为第一颜色,且所述文字颜色与所述第一颜色的相似度达到预设相似度时,将所述文字颜色设置为第二颜色,例如当背景颜色被判定为黑色时,且文字颜色为黑色,则将文字颜色设置为白色。
S42,当所述背景颜色为第二颜色,且所述文字颜色与所述第二颜色的相似度达到预设相似度时,将所述文字颜色设置为第一颜色。当背景颜色被判定为白色时,且文字颜色为白色,则将文字颜色设置为黑色。由此本方案只需在两种颜色之间进行切换,不必计算复杂的色差,由此可以提高设置操作的效率。
实施例2
本申请实施例提供了一种文字颜色设置装置,如图2所示,该装置包括:
文字颜色获取单元21,和文字颜色;
背景颜色获取单元22,用于获取背景颜色;
相似度判断单元23,用于判断所述背景颜色和文字颜色的相似度是否达到预设相似度;
文字颜色设置单元24,用于当所述背景颜色和文字颜色的相似度达到预设相似度时,修改所述文字颜色,修改后的文字颜色与所述背景颜色的 相似度低于所述预设相似度。
根据本申请提供的文字颜色设置装置,对文字颜色和背景颜色进行获取,并分析二者的相似度是否达到预设相似度,当相似度较高时,自动修改文字的颜色,并使修改后的文字颜色与背景颜色的相似度低于预设相似度,本申请可以在用户或操作系统更换背景时触发执行,实现根据背景颜色自动地对文字颜色进行设置,而不必等到用户发现辨识困难时手动进行设置,本申请具有较强的便利性。
优选地,所述背景颜色获取单元包括:
图片获取单元,用于获取背景图片;
主颜色分析单元,用于分析所述背景图片的主颜色;
比对单元,用于比对所述背景图片的主颜色与预定阈值;
背景颜色确定单元,用于根据所述背景图片的主颜色与预定阈值的比对结果确定背景颜色。
优选地,所述主颜色分析单元包括:
像素点颜色识别单元,用于确定所述背景图片上的每个像素点的颜色;
像素点颜色统计单元,用于统计各种颜色对应的像素点的数量;
主颜色确定单元,用于根据所述各种颜色对应的像素点的数量确定一个主颜色。
优选地,所述背景颜色确定单元包括:
第一颜色确定单元,用于当所述背景图片的主颜色低于所述预定阈值时,将背景颜色确定为第一颜色;
第二颜色确定单元,用于当所述背景图片的主颜色高于所述预定阈值 时,将背景颜色确定为第二颜色。
优选地,所述文字颜色设置单元包括:
第一颜色设置单元,用于当所述背景颜色为第一颜色,且所述文字颜色与所述第一颜色的相似度达到预设相似度时,将所述文字颜色设置为第二颜色;
第二颜色设置单元,用于当所述背景颜色为第二颜色,且所述文字颜色与所述第二颜色的相似度达到预设相似度时,将所述文字颜色设置为第一颜色。
实施例3
本申请还提供了一种电子设备,如图3所示,包括至少一个处理器810;以及,与所述至少一个处理器810通信连接的存储器800;其中,所述存储器800存储有可被所述至少一个处理器810执行的指令,所述指令被所述至少一个处理器810执行,以使所述至少一个处理器810能够:获取文字颜色;获取背景颜色;判断所述背景颜色和文字颜色的相似度是否达到预设相似度;当所述背景颜色和文字颜色的相似度达到预设相似度时,修改所述文字颜色,修改后的文字颜色与所述背景颜色的相似度低于所述预设相似度。所述电子设备还包括与所述存储器800和所述处理器电连接的输入装置830和输出装置840,所述电连接优选为通过总线连接。
本实施例的所述电子设备,优选地,所述获取背景颜色,包括:获取背景图片;分析所述背景图片的主颜色;比对所述背景图片的主颜色与预定阈值;根据所述背景图片的主颜色与预定阈值的比对结果确定背景颜色。
本实施例的所述电子设备,优选地,所述分析背景图片的主颜色,包 括:确定所述背景图片上的每个像素点的颜色;统计各种颜色对应的像素点的数量;根据所述各种颜色对应的像素点的数量确定一个主颜色。
本实施例的所述电子设备,优选地,所述根据所述背景图片的主颜色与预定阈值的比对结果确定背景颜色,包括:当所述背景图片的主颜色低于所述预定阈值时,将背景颜色确定为第一颜色;当所述背景图片的主颜色高于所述预定阈值时,将背景颜色确定为第二颜色。
本实施例的所述电子设备,优选地,所述当所述背景颜色和文字颜色的相似度达到预设相似度时,修改所述文字颜色,修改后的文字颜色与所述背景颜色的相似度低于所述预设相似度,包括:当所述背景颜色为第一颜色,且所述文字颜色与所述第一颜色的相似度达到预设相似度时,将所述文字颜色设置为第二颜色;当所述背景颜色为第二颜色,且所述文字颜色与所述第二颜色的相似度达到预设相似度时,将所述文字颜色设置为第一颜色。
实施例4
本申请实施例还提供了一种非易失性计算机存储介质,所述存储介质存储有计算机可执行指令的所述计算机可执行指令,当由电子设备执行时使得电子设备能够:获取文字颜色;获取背景颜色;判断所述背景颜色和文字颜色的相似度是否达到预设相似度;当所述背景颜色和文字颜色的相似度达到预设相似度时,修改所述文字颜色,修改后的文字颜色与所述背景颜色的相似度低于所述预设相似度。
本实施例的所述存储介质,优选地,所述获取背景颜色,包括:获取背景图片;分析所述背景图片的主颜色;比对所述背景图片的主颜色与预 定阈值;根据所述背景图片的主颜色与预定阈值的比对结果确定背景颜色。
本实施例的所述存储介质,优选地,所述分析背景图片的主颜色,包括:确定所述背景图片上的每个像素点的颜色;统计各种颜色对应的像素点的数量;根据所述各种颜色对应的像素点的数量确定一个主颜色。
本实施例的所述存储介质,优选地,所述根据所述背景图片的主颜色与预定阈值的比对结果确定背景颜色,包括:当所述背景图片的主颜色低于所述预定阈值时,将背景颜色确定为第一颜色;当所述背景图片的主颜色高于所述预定阈值时,将背景颜色确定为第二颜色。
本实施例的所述存储介质,优选地,所述当所述背景颜色和文字颜色的相似度达到预设相似度时,修改所述文字颜色,修改后的文字颜色与所述背景颜色的相似度低于所述预设相似度,包括:当所述背景颜色为第一颜色,且所述文字颜色与所述第一颜色的相似度达到预设相似度时,将所述文字颜色设置为第二颜色;当所述背景颜色为第二颜色,且所述文字颜色与所述第二颜色的相似度达到预设相似度时,将所述文字颜色设置为第一颜色。
实施例5
本申请实施例还提供了一种计算机程序产品,所述计算机程序产品包括存储在非暂态计算机可读存储介质上的计算机程序,所述计算机程序包括程序指令,其特征在于,当所述程序指令被计算机执行时,使所述计算机执行上述任一方法。
本领域内的技术人员应明白,本申请的实施例可提供为方法、系统、 或计算机程序产品。因此,本申请可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本申请可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。
本申请是参照根据本申请实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的 功能的步骤。显然,上述实施例仅仅是为清楚地说明所作的举例,而并非对实施方式的限定。对于所属领域的普通技术人员来说,在上述说明的基础上还可以做出其它不同形式的变化或变动。这里无需也无法对所有的实施方式予以穷举。而由此所引伸出的显而易见的变化或变动仍处于本发明创造的保护范围之中。

Claims (21)

  1. 一种文字颜色设置方法,其特征在于,包括:
    获取文字颜色;
    获取背景颜色;
    判断所述背景颜色和文字颜色的相似度是否达到预设相似度;
    当所述背景颜色和文字颜色的相似度达到预设相似度时,修改所述文字颜色,修改后的文字颜色与所述背景颜色的相似度低于所述预设相似度。
  2. 根据权利要求1所述的文字颜色设置方法,其特征在于,所述获取背景颜色,包括:
    获取背景图片;
    分析所述背景图片的主颜色;
    比对所述背景图片的主颜色与预定阈值;
    根据所述背景图片的主颜色与预定阈值的比对结果确定背景颜色。
  3. 根据权利要求2所述的文字颜色设置方法,其特征在于,所述分析背景图片的主颜色,包括:
    确定所述背景图片上的每个像素点的颜色;
    统计各种颜色对应的像素点的数量;
    根据所述各种颜色对应的像素点的数量确定一个主颜色。
  4. 根据权利要求2所述的文字颜色设置方法,其特征在于,所述根据所述背景图片的主颜色与预定阈值的比对结果确定背景颜色,包括:
    当所述背景图片的主颜色低于所述预定阈值时,将背景颜色确定为第一颜色;
    当所述背景图片的主颜色高于所述预定阈值时,将背景颜色确定为第二颜色。
  5. 根据权利要求4所述的文字颜色设置方法,其特征在于,所述当所述背景颜色和文字颜色的相似度达到预设相似度时,修改所述文字颜色,修改后的文字颜色与所述背景颜色的相似度低于所述预设相似度,包括:
    当所述背景颜色为第一颜色,且所述文字颜色与所述第一颜色的相似度达到预设相似度时,将所述文字颜色设置为第二颜色;
    当所述背景颜色为第二颜色,且所述文字颜色与所述第二颜色的相似度达到预设相似度时,将所述文字颜色设置为第一颜色。
  6. 一种文字颜色设置装置,其特征在于,包括:
    文字颜色获取单元,和文字颜色;
    背景颜色获取单元,用于获取背景颜色;
    相似度判断单元,用于判断所述背景颜色和文字颜色的相似度是否达到预设相似度;
    文字颜色设置单元,用于当所述背景颜色和文字颜色的相似度达到预设相似度时,修改所述文字颜色,修改后的文字颜色与所述背景颜色的相似度低于所述预设相似度。
  7. 根据权利要求6所述的文字颜色设置装置,其特征在于,所述背景颜色获取单元包括:
    图片获取单元,用于获取背景图片;
    主颜色分析单元,用于分析所述背景图片的主颜色;
    比对单元,用于比对所述背景图片的主颜色与预定阈值;
    背景颜色确定单元,用于根据所述背景图片的主颜色与预定阈值的比对结果确定背景颜色。
  8. 根据权利要求7所述的文字颜色设置装置,其特征在于,所述主颜色分析单元包括:
    像素点颜色识别单元,用于确定所述背景图片上的每个像素点的颜色;
    像素点颜色统计单元,用于统计各种颜色对应的像素点的数量;
    主颜色确定单元,用于根据所述各种颜色对应的像素点的数量确定一个主颜色。
  9. 根据权利要求7所述的文字颜色设置装置,其特征在于,所述背景颜色确定单元包括:
    第一颜色确定单元,用于当所述背景图片的主颜色低于所述预定阈值时,将背景颜色确定为第一颜色;
    第二颜色确定单元,用于当所述背景图片的主颜色高于所述预定阈值时,将背景颜色确定为第二颜色。
  10. 根据权利要求9所述的文字颜色设置装置,其特征在于,所述文字颜色设置单元包括:
    第一颜色设置单元,用于当所述背景颜色为第一颜色,且所述文字颜色与所述第一颜色的相似度达到预设相似度时,将所述文字颜色设置为第二颜色;
    第二颜色设置单元,用于当所述背景颜色为第二颜色,且所述文字颜色与所述第二颜色的相似度达到预设相似度时,将所述文字颜色设置为第一颜色。
  11. 一种电子设备,其特征在于,包括至少一个处理器;以及,与所述至少一个处理器通信连接的存储器;其中,所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器能够:
    获取文字颜色;
    获取背景颜色;
    判断所述背景颜色和文字颜色的相似度是否达到预设相似度;
    当所述背景颜色和文字颜色的相似度达到预设相似度时,修改所述文字颜色,修改后的文字颜色与所述背景颜色的相似度低于所述预设相似度。
  12. 根据权利要求11所述的电子设备,其特征在于,所述获取背景颜色,包括:
    获取背景图片;
    分析所述背景图片的主颜色;
    比对所述背景图片的主颜色与预定阈值;
    根据所述背景图片的主颜色与预定阈值的比对结果确定背景颜色。
  13. 根据权利要求12所述的电子设备,其特征在于,所述分析背景图片的主颜色,包括:
    确定所述背景图片上的每个像素点的颜色;
    统计各种颜色对应的像素点的数量;
    根据所述各种颜色对应的像素点的数量确定一个主颜色。
  14. 根据权利要求12所述的电子设备,其特征在于,所述根据所述背景图片的主颜色与预定阈值的比对结果确定背景颜色,包括:
    当所述背景图片的主颜色低于所述预定阈值时,将背景颜色确定为第一颜色;
    当所述背景图片的主颜色高于所述预定阈值时,将背景颜色确定为第二颜色。
  15. 根据权利要求14所述的电子设备,其特征在于,所述当所述背景颜色和文字颜色的相似度达到预设相似度时,修改所述文字颜色,修改后的文字颜色与所述背景颜色的相似度低于所述预设相似度,包括:
    当所述背景颜色为第一颜色,且所述文字颜色与所述第一颜色的相似度达到预设相似度时,将所述文字颜色设置为第二颜色;
    当所述背景颜色为第二颜色,且所述文字颜色与所述第二颜色的相似度达到预设相似度时,将所述文字颜色设置为第一颜色。
  16. 一种非易失性计算机存储介质,其特征在于:所述存储介质存储有计算机可执行指令的所述计算机可执行指令,当由电子设备执行时使得电子设备能够:
    获取文字颜色;
    获取背景颜色;
    判断所述背景颜色和文字颜色的相似度是否达到预设相似度;
    当所述背景颜色和文字颜色的相似度达到预设相似度时,修改所述文字颜色,修改后的文字颜色与所述背景颜色的相似度低于所述预设相似度。
  17. 根据权利要求16所述的存储介质,其特征在于,所述获取背景颜色,包括:
    获取背景图片;
    分析所述背景图片的主颜色;
    比对所述背景图片的主颜色与预定阈值;
    根据所述背景图片的主颜色与预定阈值的比对结果确定背景颜色。
  18. 根据权利要求17所述的存储介质,其特征在于,所述分析背景图片的主颜色,包括:
    确定所述背景图片上的每个像素点的颜色;
    统计各种颜色对应的像素点的数量;
    根据所述各种颜色对应的像素点的数量确定一个主颜色。
  19. 根据权利要求17所述的存储介质,其特征在于,所述根据所述背景图片的主颜色与预定阈值的比对结果确定背景颜色,包括:
    当所述背景图片的主颜色低于所述预定阈值时,将背景颜色确定为第一颜色;
    当所述背景图片的主颜色高于所述预定阈值时,将背景颜色确定为第二颜色。
  20. 根据权利要求19所述的存储介质,其特征在于,所述当所述背景颜色和文字颜色的相似度达到预设相似度时,修改所述文字颜色,修改后的文字颜色与所述背景颜色的相似度低于所述预设相似度,包括:
    当所述背景颜色为第一颜色,且所述文字颜色与所述第一颜色的相似度达到预设相似度时,将所述文字颜色设置为第二颜色;
    当所述背景颜色为第二颜色,且所述文字颜色与所述第二颜色的相似度达到预设相似度时,将所述文字颜色设置为第一颜色。
  21. 一种计算机程序产品,所述计算机程序产品包括存储在非暂态计算 机可读存储介质上的计算机程序,所述计算机程序包括程序指令,其特征在于,当所述程序指令被计算机执行时,使所述计算机执行上述任一权利要求所述的方法。
PCT/CN2016/100250 2016-04-01 2016-09-27 一种文字颜色设置方法、装置和电子设备 WO2017166752A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610203274.XA CN105912321A (zh) 2016-04-01 2016-04-01 一种文字颜色设置方法及装置
CN201610203274.X 2016-04-01

Publications (1)

Publication Number Publication Date
WO2017166752A1 true WO2017166752A1 (zh) 2017-10-05

Family

ID=56744523

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/100250 WO2017166752A1 (zh) 2016-04-01 2016-09-27 一种文字颜色设置方法、装置和电子设备

Country Status (2)

Country Link
CN (1) CN105912321A (zh)
WO (1) WO2017166752A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2020042997A1 (zh) * 2018-08-27 2020-03-05 华为技术有限公司 一种界面元素颜色显示方法及装置

Families Citing this family (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105912321A (zh) * 2016-04-01 2016-08-31 乐视控股(北京)有限公司 一种文字颜色设置方法及装置
CN106547912A (zh) * 2016-11-25 2017-03-29 西安理工大学 身份证数据库中非二代身份证照片的识别和剔除方法
CN106598436B (zh) * 2016-12-21 2018-07-20 掌阅科技股份有限公司 电子书标记的显示方法、装置和终端设备
CN106775747B (zh) * 2016-12-28 2020-03-24 Tcl集团股份有限公司 一种颜色配置的方法和装置
CN106713655A (zh) * 2017-01-11 2017-05-24 努比亚技术有限公司 一种移动终端及文字显示方法
CN106713661B (zh) * 2017-01-19 2019-10-25 努比亚技术有限公司 一种移动终端及显示文字的方法
CN106851003A (zh) * 2017-02-27 2017-06-13 努比亚技术有限公司 根据壁纸颜色调整文字颜色的方法及装置
CN108733640A (zh) * 2017-04-24 2018-11-02 珠海金山办公软件有限公司 一种文档配色方案生成方法及装置
CN107766302A (zh) * 2017-09-28 2018-03-06 苏州亿科赛卓电子科技有限公司 一种文档下划线动态调整方法、装置及终端
CN111198636A (zh) * 2018-11-20 2020-05-26 北京京东尚科信息技术有限公司 一种状态栏的显示方法、终端及存储介质
CN111368502A (zh) * 2019-05-15 2020-07-03 深圳市鸿合创新信息技术有限责任公司 一种修改文字颜色的方法、装置、设备及存储介质
CN111125999B (zh) * 2019-12-25 2021-03-12 上海云从企业发展有限公司 文字颜色调节方法、系统、设备及机器可读介质
CN114138215A (zh) * 2020-09-04 2022-03-04 华为技术有限公司 一种显示方法及相关设备
CN114896007A (zh) * 2022-04-29 2022-08-12 钉钉(中国)信息技术有限公司 颜色调整方法、装置、存储介质及系统

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140016151A1 (en) * 2012-07-10 2014-01-16 Xerox Corporation Method and system for facilitating modification of text colors in digital images
CN104050004A (zh) * 2014-06-30 2014-09-17 宇龙计算机通信科技(深圳)有限公司 界面图标色彩设置方法、装置及终端
CN104076928A (zh) * 2014-07-15 2014-10-01 深圳市金立通信设备有限公司 一种调整文字显示区域色调的方法
CN104978189A (zh) * 2015-06-19 2015-10-14 深圳天珑无线科技有限公司 应用描述的文字颜色更改方法、装置及移动终端
CN105912321A (zh) * 2016-04-01 2016-08-31 乐视控股(北京)有限公司 一种文字颜色设置方法及装置

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101605175B (zh) * 2009-07-13 2012-04-18 中兴通讯股份有限公司 一种移动终端显示桌面文字颜色的方法及装置
CN101840693B (zh) * 2010-03-05 2013-08-14 惠州Tcl移动通信有限公司 一种电子文档显示方法
CN103137103B (zh) * 2011-12-05 2016-09-14 南京中兴新软件有限责任公司 文字显示方法及装置
CN103049471A (zh) * 2012-09-15 2013-04-17 珠海金山办公软件有限公司 自动调整演示文档中文字或背景颜色的方法及系统
CN103544931B (zh) * 2013-10-12 2017-04-19 Tcl集团股份有限公司 一种文字的生成方法、装置及应用终端

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140016151A1 (en) * 2012-07-10 2014-01-16 Xerox Corporation Method and system for facilitating modification of text colors in digital images
CN104050004A (zh) * 2014-06-30 2014-09-17 宇龙计算机通信科技(深圳)有限公司 界面图标色彩设置方法、装置及终端
CN104076928A (zh) * 2014-07-15 2014-10-01 深圳市金立通信设备有限公司 一种调整文字显示区域色调的方法
CN104978189A (zh) * 2015-06-19 2015-10-14 深圳天珑无线科技有限公司 应用描述的文字颜色更改方法、装置及移动终端
CN105912321A (zh) * 2016-04-01 2016-08-31 乐视控股(北京)有限公司 一种文字颜色设置方法及装置

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2020042997A1 (zh) * 2018-08-27 2020-03-05 华为技术有限公司 一种界面元素颜色显示方法及装置
US11423590B2 (en) 2018-08-27 2022-08-23 Huawei Technologies Co., Ltd. Interface element color display method and apparatus
US11663754B2 (en) 2018-08-27 2023-05-30 Huawei Technologies Co., Ltd. Interface element color display method and apparatus

Also Published As

Publication number Publication date
CN105912321A (zh) 2016-08-31

Similar Documents

Publication Publication Date Title
WO2017166752A1 (zh) 一种文字颜色设置方法、装置和电子设备
US10990806B2 (en) Facial image processing method, terminal, and data storage medium
CN107945769B (zh) 环境光强度检测方法、装置、存储介质及电子设备
US9922235B2 (en) Authenticating a user through fingerprint recognition
TWI684886B (zh) 安全問題的生成以及身份驗證的方法及裝置
CN105957125B (zh) 一种图标文字的处理方法及移动终端
US20200364457A1 (en) Emotion recognition-based artwork recommendation method and device, medium, and electronic apparatus
WO2017152762A1 (zh) 界面色彩调节方法、网页色彩调节方法及装置
CN108701365B (zh) 光点识别方法、装置以及系统
US8929679B1 (en) Systems and methods for changing contrast based on brightness of an output for presentation on a display
US20160358592A1 (en) Text legibility over images
CN103135903B (zh) 一种图库展示方法及装置
WO2015070682A1 (zh) 一种音频文件的播控处理方法、装置及存储介质
CN106778627B (zh) 检测人脸颜值的方法、装置和移动终端
WO2016165352A1 (zh) 一种实现消息提醒的方法及终端
CN104834382A (zh) 移动终端应用程序响应系统及方法
WO2017185623A1 (zh) 一种计算器的显示管理方法、装置和电子设备
US10728297B2 (en) Streaming media play mode determination method and apparatus
US20200348799A1 (en) Implementation method and apparatus of system user interface
CN113409608A (zh) 针对交通信号灯的提示方法、装置、车辆和电子设备
KR102236203B1 (ko) 서비스를 제공하는 방법 및 그 전자 장치
CN104869254B (zh) 移动终端及其来电提醒系统和方法
CN107292279B (zh) 显示方法、装置、终端及计算机可读存储介质
KR20200101067A (ko) 어플리케이션의 실행 화면을 표시하는 전자장치 및 그 제어 방법
CN111198636A (zh) 一种状态栏的显示方法、终端及存储介质

Legal Events

Date Code Title Description
NENP Non-entry into the national phase

Ref country code: DE

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

Ref document number: 16896522

Country of ref document: EP

Kind code of ref document: A1

122 Ep: pct application non-entry in european phase

Ref document number: 16896522

Country of ref document: EP

Kind code of ref document: A1