WO2016034031A1 - Method and device for adjusting colour of webpage content - Google Patents

Method and device for adjusting colour of webpage content Download PDF

Info

Publication number
WO2016034031A1
WO2016034031A1 PCT/CN2015/086767 CN2015086767W WO2016034031A1 WO 2016034031 A1 WO2016034031 A1 WO 2016034031A1 CN 2015086767 W CN2015086767 W CN 2015086767W WO 2016034031 A1 WO2016034031 A1 WO 2016034031A1
Authority
WO
WIPO (PCT)
Prior art keywords
color
value
brightness
background
brightness value
Prior art date
Application number
PCT/CN2015/086767
Other languages
French (fr)
Chinese (zh)
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 WO2016034031A1 publication Critical patent/WO2016034031A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor

Definitions

  • the present invention relates to the field of mobile internet technologies, and more particularly to a method and apparatus for adjusting the color of a web page content.
  • the adjustment of the color of the webpage is usually implemented by changing the transparency parameter of the webpage.
  • this solution has major drawbacks.
  • the flexibility is not high.
  • the definition of the color of the webpage cannot be freely defined. For example, if the current webpage is blue, and the user wants to adjust the webpage to pink, The method of adjusting the transparency parameter of the webpage cannot be implemented; the second is that the user completes the setting of the transparency parameter through the interface interaction layer, and the setting mode is not intuitive, and the user is more difficult to grasp the conversion effect, and even brings a significant negative experience to the user.
  • the present invention provides a method and apparatus for adjusting the color of a webpage content, by which the webpage element is identified, and then the color of the webpage element is adjusted based on the brightness value of the webpage element, thereby achieving flexibility Change the color of the content of the web page.
  • a method for adjusting a color of a webpage content including: obtaining After the instruction for adjusting the color of the webpage content, the webpage element to be adjusted is identified from the webpage to be processed, the webpage element to be adjusted includes at least a background element; the brightness value of each identified background element is obtained; The color adjustment rules and the brightness values of the acquired background elements are adjusted to adjust the color of each background element.
  • the color adjustment rule includes a plurality of brightness value intervals and a color adjustment target color value corresponding to each brightness value interval, and the union of the plurality of brightness value intervals is [first predetermined a value, a second predetermined value, and a predetermined color adjustment rule and a brightness value of each of the acquired background elements.
  • Adjusting the color of each of the background elements includes: determining a brightness value interval in which the obtained brightness values of the respective background elements are located And adjusting the color value of the color of each background element to the color adjustment target color value corresponding to the determined brightness value interval.
  • adjusting the color of each of the background elements based on the predetermined color adjustment rule and the brightness value of each of the acquired background elements further includes: determining that the brightness value is not present in each of the acquired background elements When the background element of any of the brightness value intervals is located, the color of the background element is kept unchanged.
  • the method before acquiring the brightness values of the respective identified background elements, the method further comprises: obtaining purity values of the respective identified background elements, and acquiring each identified The brightness value of the background element includes: obtaining a brightness value of the background element in which the purity value of each of the identified background elements is less than a third predetermined value.
  • the to-be-adjusted webpage element further includes text
  • the method further includes: obtaining a purity value of each of the recognized characters; and presenting in each of the recognized texts When the purity value is greater than the fourth predetermined value, the color of the character is adjusted to a predetermined text color value.
  • the to-be-adjusted webpage element further includes a stroke
  • the color adjustment rule includes a plurality of brightness value intervals and color adjustment target color values corresponding to the respective brightness value intervals
  • the plurality of The union of the brightness value intervals is [first predetermined value, second predetermined value]
  • the method further comprises: obtaining purity values of the respective identified strokes; and presenting in each identified stroke When the purity value is less than the stroke of the fifth predetermined value, the brightness value of the stroke is obtained, and when the brightness value of the stroke is within the predetermined range, the color value of the color of the stroke is adjusted to be the same as the stroke The color corresponding to the brightness value adjusts the target color value.
  • the depth of the color adjustment target color value corresponding to each brightness value interval has a correspondence relationship with the brightness size, and the correspondence relationship is: the brightness value is more Large, the color adjustment target color value is shallower.
  • an apparatus for adjusting a color of a webpage content comprising: a webpage element identification unit, configured to identify a to-be-processed webpage after obtaining an instruction for adjusting a color of a webpage content
  • the adjusted webpage element, the webpage element to be adjusted includes at least a background element; a brightness value obtaining unit configured to acquire a brightness value of each of the identified background elements; and a color adjustment unit configured to adjust the rule based on the predetermined color and The brightness value of each background element obtained is adjusted to adjust the color of each background element.
  • the color adjustment rule includes a plurality of brightness value intervals and a color adjustment target color value corresponding to each brightness value interval, and the union of the plurality of brightness value intervals is [first predetermined a value, a second predetermined value
  • the color adjustment unit includes a brightness interval determination module and an adjustment module, the color adjustment unit adjusting each of the background elements based on the predetermined color adjustment rule and the acquired brightness values of the respective background elements
  • the color includes: the brightness interval determination module determines a brightness value interval in which the acquired brightness values of the respective background elements are located; and the adjustment module adjusts the color values of the colors of the respective background elements to the determined brightness value intervals. The color adjusts the target color value.
  • the color adjustment unit adjusts the color of each of the background elements based on the predetermined color adjustment rule and the brightness value of each of the acquired background elements, further comprising: determining, by the brightness interval determination module When there is a background element in each of the acquired background elements whose brightness value is not located in any of the brightness value intervals, the color of the background element is kept unchanged.
  • the apparatus further includes: a purity value acquisition unit, before the brightness value acquisition unit acquires the brightness values of the respective identified background elements,
  • the purity value acquisition unit acquires purity values of the respective identified background elements
  • the obtaining the brightness value of each of the identified background elements by the brightness value obtaining unit includes: acquiring a brightness value of the background element in which the purity value of each of the background elements is less than a third predetermined value.
  • the to-be-adjusted webpage element further includes a text, and the purity value acquisition unit acquires a purity value of each of the recognized characters; and the color adjustment unit identifies each When there is a character whose purity value is greater than the fourth predetermined value, the color of the character is adjusted to a predetermined character color value.
  • the to-be-adjusted webpage element further includes a stroke
  • the color adjustment rule includes a plurality of brightness value intervals and color adjustment target color values corresponding to the respective brightness value intervals
  • the plurality of The union of the brightness value intervals is [the first predetermined value, the second predetermined value]
  • the method further includes: the purity value acquisition unit acquires the purity values of the respective identified strokes; and identifies each There is pure in the stroke
  • the degree value is less than the stroke of the fifth predetermined value
  • the brightness value acquisition unit acquires the brightness value of the stroke, and when the brightness value of the stroke is within the predetermined range, the color adjustment unit compares the color of the stroke The color value is adjusted to a color adjustment target color value corresponding to the brightness value of the stroke.
  • the depth of the color adjustment target color value corresponding to each brightness value interval has a correspondence relationship with the brightness size, and the correspondence relationship is: the brightness value is more Large, the color adjustment target color value is shallower.
  • a terminal device comprising the apparatus as described in any one of the above examples.
  • a terminal device comprising: a memory for storing instructions; a processor coupled to the memory, the processor being configured to execute instructions stored in the memory, wherein The instructions stored in the memory and the method described by the processor for implementing one or more embodiments of the method of adjusting the color of a web page content as described above.
  • a computer readable medium having program code executable by a processor, the program code causing a processor to perform the following steps:
  • the webpage element to be adjusted is identified from the webpage to be processed, and the webpage element to be adjusted includes at least a background element;
  • the color of each background element is adjusted based on predetermined color adjustment rules and the brightness values of the acquired various background elements.
  • the webpage element in the webpage is identified, and then the background element of the webpage is color-adjusted according to the brightness information of the webpage background element, because different brightness information Corresponding to different color values, background elements with different brightness have different color values, which can make the background color of the page be adjusted, and ensure that different background elements in the page can have color values different from other background elements, and the whole will not appear.
  • the background of the page is mixed, the background of the page after adjusting the color is more layered and more harmonious.
  • the application can realize the free definition of the color of the webpage, and the flexibility of the color adjustment is high, and the method adjusts the background color by the preset color adjustment rule and the brightness value of each background element, and the setting manner is intuitive and convenient for the user. Grasp the conversion effect.
  • FIG. 1A illustrates a flow chart of a method of adjusting color of web page content in accordance with an embodiment of the present invention
  • FIG. 1B shows a schematic diagram of a web page background color option set on a browser
  • FIG. 2 is a detailed flowchart showing a method of adjusting a color of a background element in a webpage according to another embodiment of the present invention
  • FIG. 3 is a detailed flowchart showing a method of adjusting the color of a text in a webpage according to another embodiment of the present invention.
  • FIG. 4 is a detailed flowchart showing a method of adjusting a stroke color in a webpage according to another embodiment of the present invention.
  • Figure 5 is a block schematic diagram of an apparatus for adjusting the color of web page content in accordance with an embodiment of the present invention.
  • FIG. 1A shows a flow chart of a method of adjusting the color of a web page content in accordance with an embodiment of the present invention.
  • step S110 after the instruction for adjusting the color of the webpage content is acquired, the webpage element to be adjusted is identified from the webpage to be processed, and the webpage element to be adjusted includes at least a background element.
  • the instruction for adjusting the color of the webpage content is selected by the user to select the "web background color" on the browser. Triggered by the item. As shown in FIG. 1B, a plurality of web page background color options are set on the browser for the user to select, such as “classic white”, “eye green” and “childish powder”, etc., the user can select through touch operation according to his own needs.
  • the user may also receive the required color input, and obtain an instruction for the user to adjust the color of the webpage content. For example, if the user needs to adjust the webpage content to blue, the input may include “blue” in the terminal that performs the color adjustment of the webpage content. Instructing the content, so that the terminal acquires an instruction for adjusting the color of the webpage content corresponding to the indicated content. That is to say, by the instruction for adjusting the color of the webpage content, the color of the webpage content to be adjusted can be acquired.
  • the webpage content is composed of a plurality of types of webpage elements
  • the background element is one of webpage elements
  • the background element includes a background of each content block of the page, such as a title bar background, a body background , navigation bar background, etc.
  • webpage elements such as input boxes
  • the webpage content usually includes other types of webpage elements such as text, pictures, and strokes.
  • step S120 the brightness values of the respective identified background elements are acquired.
  • Brightness is one of the three elements of color, which refers to the brightness or brightness of a color, and can represent the shades of light, light and dark changes. The higher the brightness value, the brighter the color. The brightness value is expressed as a percentage. The larger the ratio, the brighter the color, and the lower the ratio, the darker the color.
  • step S130 the colors of the respective background elements are adjusted based on the predetermined color adjustment rule and the acquired brightness values of the respective background elements.
  • the color adjustment rule includes a plurality of brightness value intervals and color adjustment target color values corresponding to the respective brightness value intervals, and the union of the plurality of brightness value intervals is [first predetermined value, a predetermined value], and adjusting the color of each of the background elements based on the predetermined color adjustment rule and the brightness value of each of the acquired background elements, including: determining a brightness value interval in which the acquired brightness values of the respective background elements are located; The color value of the color of each background element is adjusted to the color adjustment target color value corresponding to the determined brightness value interval.
  • the color of the background element is adjusted based on the brightness interval of the background element, so that different background elements in the page can maintain their own characteristics when changing the color to the color theme specified by the user.
  • the method of the embodiment can realize the free definition of the color of the webpage, and the flexibility of the color adjustment is high, and the method adjusts the background color by the preset color adjustment rule and the brightness value of each background element, and the setting mode is intuitive. It is convenient for users to grasp the conversion effect.
  • the color of the background element is adjusted according to the brightness interval of the background element, It can make the background elements with different brightness have different color values, so that the background color of the page is adjusted, and the different background elements in the page can have the color values different from other background elements, and the entire background of the page will not be mixed. In the case, the background of the page after adjusting the color is more layered and more harmonious.
  • the color adjustment of each background element may be determined according to the brightness value of each background element and the color corresponding to each brightness value interval included in the color adjustment rule.
  • the target color value is used to adjust the various background elements.
  • the brightness value of the background element of the value is adjusted according to the brightness value of each background element obtained, so that the color of the webpage is more vivid and beautiful.
  • FIG. 2 shows a detailed flow chart of a method of adjusting the color of a background element in a web page in accordance with another embodiment of the present invention.
  • step S210 the purity value of the background element is acquired.
  • Purity usually refers to the vividness of color. The higher the purity, the brighter the color. The purity value is expressed as a percentage. The higher the ratio, the higher the color purity, and the lower the ratio, the lower the purity of the color.
  • step S220 it is judged whether the purity value is smaller than the third predetermined value; if yes, the process proceeds to step S230; otherwise, the process ends, the background element is not processed, that is, the color of the background element is kept unchanged.
  • the third predetermined value is 5%. That is to say, when the purity value of the background element is less than 5%, the color of the background element is adjusted according to the color adjustment rule and the brightness value of each background element. If the purity value of the background element is greater than or equal to 5%, the background element is maintained. The color does not change.
  • Step S230 acquiring a brightness value of the background element.
  • Step S240 determining whether the brightness value of the background element is located in any predetermined brightness value interval; if yes, proceeding to step S250, otherwise the process ends, the background element is not processed, that is, the color of the background element is not maintained. change.
  • there are a plurality of brightness intervals which are (65%, 80%), (80%, 90%), (90%, 96%), (96%, 100%). It is said that only background elements with a brightness value greater than 65% have a corresponding brightness interval, while background elements with a brightness value less than or equal to 65% will not be processed.
  • step S250 determining a brightness value interval in which the brightness value of the background element is located, the back The color value of the color of the scene element is adjusted to the color adjustment target color value corresponding to the determined brightness value interval.
  • the depth of the color adjustment target color value corresponding to each brightness value interval has a corresponding relationship with the brightness, and the corresponding relationship is: the greater the brightness value, the lighter the color adjustment target color value.
  • the background element with a large brightness value is originally lighter, so the adjustment is still for a lighter color.
  • FIG. 1B if the obtained instruction for adjusting the color of the webpage content indicates that the background element needs to be adjusted to "eye green”, the background element is adjusted to green, and according to each background element The brightness value, and each brightness value interval included in the color adjustment rule and the color adjustment target color value corresponding to each brightness value interval, each background element is adjusted to a different shade of green.
  • the webpage when the color of the webpage element is adjusted, the webpage can be adjusted to different colors according to the user's needs, for example, "classic white”, “eye green” and “childish powder".
  • the target color that the webpage element needs to be adjusted in the adjustment operation can be determined.
  • different colors include a plurality of brightness value intervals, and color adjustment target color values corresponding to the respective brightness value intervals. For example, if the target color to be adjusted by the background element is green, it is determined according to the target color that a plurality of brightness value intervals included in the green color and a color adjustment target color value corresponding to each brightness value interval are selected for the current adjustment operation. , so that the color of the background can be adjusted to a different shade of green.
  • the to-be-adjusted webpage element further includes a text element.
  • FIG. 3 illustrates a flow chart of a method of adjusting the color of text in a web page in accordance with another embodiment of the present invention.
  • step S310 the purity value of the character is acquired.
  • step S320 it is judged whether the purity value is greater than the fourth predetermined value; if yes, the process proceeds to step S330; otherwise, the process ends, the text is not processed, that is, the color of the character is kept unchanged.
  • the fourth predetermined value is 10%.
  • Step S330 adjusting the color of the character to a predetermined text color value.
  • the to-be-adjusted webpage element further includes a stroke.
  • 4 shows a flow chart of a method of adjusting the stroke color in a web page in accordance with another embodiment of the present invention.
  • step S410 the purity value of the stroke is obtained.
  • step S420 it is judged whether the purity value is smaller than the fifth predetermined value; if yes, the process proceeds to step S430, otherwise the flow ends, and the stroke is not processed, that is, the color of the stroke is kept unchanged.
  • the fourth predetermined value is 12%.
  • Step S430 obtaining a brightness value of the stroke.
  • step S440 it is determined whether the brightness value of each stroke is located in any predetermined brightness value interval; if yes, the process proceeds to step S450, otherwise the process ends, and the stroke is not processed, that is, the color of the stroke is kept unchanged.
  • the predetermined color adjustment rule a plurality of brightness value intervals are defined for the page element of the stroke, and the color adjustment target color values corresponding to the respective brightness value intervals are specified.
  • Step S450 determining a brightness value interval in which the brightness value of the stroke is located, and adjusting a color value of the color of the stroke to a color adjustment target color value corresponding to the determined brightness value interval.
  • the depth of the color adjustment target color value corresponding to each brightness value interval has a corresponding relationship with the brightness, and the corresponding relationship is: the greater the brightness value, the lighter the color adjustment target color value.
  • the stroke is adjusted to pink, and according to the brightness value of the stroke, and the brightness values included in the color adjustment rule.
  • the color adjustment target color value corresponding to the interval and each brightness value interval, and the strokes with different brightness values are adjusted to different shades of pink.
  • FIG. 5 shows a block schematic diagram of an apparatus for adjusting the color of a web page content in accordance with an embodiment of the present invention.
  • the device for adjusting the color of the webpage content includes a webpage element identification unit 510, a brightness value acquisition unit 520, and a color adjustment unit 530.
  • the webpage element identification unit 510 is configured to: after obtaining the instruction for adjusting the color of the webpage content, identify the webpage element to be adjusted from the webpage to be processed, where the webpage element to be adjusted includes at least a background element; the brightness value obtaining unit 520 is configured to obtain brightness values of the respective identified background elements; and the color adjustment unit 530 is configured to adjust colors of the respective background elements based on the predetermined color adjustment rules and the brightness values of the acquired respective background elements.
  • the color adjustment rule includes a plurality of brightness value intervals and color adjustment target color values corresponding to the respective brightness value intervals, and the union of the plurality of brightness value intervals is [first predetermined value, a second predetermined value], and the color adjustment unit 530 includes a brightness interval determination module and an adjustment module, and the color adjustment unit 530 adjusts the color of each background element based on a predetermined color adjustment rule and the acquired brightness values of the respective background elements.
  • the method includes: the brightness interval determining module determines a brightness value interval in which the acquired brightness values of the respective background elements are located; and the adjusting module adjusts the color values of the colors of the respective background elements to the determined brightness The color corresponding to the degree interval adjusts the target color value.
  • the color adjustment unit adjusts the color of each background element based on the predetermined color adjustment rule and the brightness value of each of the acquired background elements.
  • the method further includes: determining, by the brightness interval determination module, that the brightness value is not present in each acquired background element. When the background element of any of the brightness value intervals is located, the color of the background element is kept unchanged.
  • the depth of the color adjustment target color value corresponding to each brightness value interval has a corresponding relationship with the brightness, and the corresponding relationship is: the greater the brightness value, the lighter the color adjustment target color value.
  • the means for adjusting the color of the webpage content further includes a purity value acquisition unit (not shown), before the brightness value acquisition unit acquires the brightness values of the respective identified background elements,
  • the purity value acquisition unit acquires the purity value of each of the identified background elements, and the brightness value acquisition unit 520 acquires the brightness value of each of the identified background elements, including: obtaining the purity value of each identified background element A brightness value of a background element that is less than a third predetermined value.
  • the to-be-adjusted webpage element further includes a text
  • the purity value acquisition unit acquires a purity value of each of the recognized characters
  • the color adjustment unit 530 identifies each of the When there is a character whose purity value is greater than the fourth predetermined value in the character, the color of the character is adjusted to a predetermined character color value.
  • the to-be-adjusted webpage element further includes a stroke
  • the method further includes: the purity value acquisition unit acquires a purity value of each identified stroke; and identifies each When there is a stroke in the stroke of which the purity value is less than the fifth predetermined value, the brightness value acquisition unit acquires the brightness value of the stroke, and when the brightness value of the stroke is within the predetermined range, the color adjustment unit 530 The color value of the color of the stroke is adjusted to a color adjustment target color value corresponding to the brightness value of the stroke.
  • a terminal device includes the device as described in FIG. 5, that is, the terminal device includes the above-described means for adjusting the color of the web page content.
  • the present invention also discloses a terminal device, including: a memory, configured to store an instruction;
  • processor coupled to the memory, the processor being configured to execute instructions stored in the memory, wherein the instructions stored in the memory and the processor are used to implement any of FIGS. 1 through 4 The method of the examples.
  • the present invention also discloses a computer readable medium having program code executable by a processor, the program code causing the processor to perform the following steps:
  • the webpage element to be adjusted includes at least a background element
  • the color of each background element is adjusted based on predetermined color adjustment rules and the brightness values of the acquired various background elements.
  • device and terminal device by identifying the webpage element in the webpage, and then performing color adjustment on the background element of the webpage according to the brightness information of the background element of the webpage, since different brightness information corresponds to different color values, the brightness is different.
  • the background elements have different color values, which can make the background color of the page be adjusted, and ensure that different background elements in the page can have color values different from other background elements, and the entire page background does not appear to be integrated.
  • corresponding color adjustment rules are respectively corresponding to the element characteristics, so that the color adjustment effect of the entire page is more harmonious, and the page is also clear and has Layering.
  • the method according to the invention can also be implemented as a computer program executed by a processor (such as a CPU) in a mobile terminal and stored in a memory of the mobile terminal.
  • a processor such as a CPU
  • the processor performs the functions described above in the method of the present invention.
  • the method according to the invention may also be embodied as a computer program product comprising a computer readable medium on which is stored a computer program for performing the functions described above in the method of the invention. .
  • the method steps and system units described above may also be implemented with a controller and a computer readable storage device for storing a computer program that causes the controller to implement the steps or unit functions described above.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Transfer Between Computers (AREA)
  • Processing Or Creating Images (AREA)
  • Color Image Communication Systems (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

Disclosed are a method and device for adjusting the colour of webpage content, the method comprising: after a command for adjusting the colour of webpage content has been obtained, a webpage element to be adjusted is identified within a webpage to be processed, the webpage element to be adjusted at least comprising a background element; a brightness value of each identified background element is obtained; on the basis of a preset colour adjustment rule and the obtained brightness value of each background element, the colour of each background element is adjusted. Via the present invention, the colour of an element within a webpage may be adjusted according to brightness information of the element within the webpage, achieving the goal of flexibly adjusting the colour of webpage content.

Description

调整网页内容颜色的方法及装置Method and device for adjusting color of webpage content
本申请要求于2014年9月3日提交中国专利局、申请号为201410446070.X、发明名称为“调整网页内容颜色的方法及装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims priority to Chinese Patent Application No. 201410446070.X, filed on September 3, 2014, entitled "Method and Apparatus for Adjusting the Color of Web Content", the entire contents of which are incorporated by reference. In this application.
技术领域Technical field
本发明涉及移动互联网技术领域,更为具体地,涉及调整网页内容颜色的方法及装置。The present invention relates to the field of mobile internet technologies, and more particularly to a method and apparatus for adjusting the color of a web page content.
背景技术Background technique
在互联网时代,用浏览器上网的用户越来越多,网页作为用户上网的主要浏览对象,大多数网页的白色背景色对用户眼睛形成较大的刺激,容易产生视觉疲劳。用户长时间面对屏幕很容易影响视力。在这种情况下,需要有较好的解决方案,减轻长时间上网对用户视力带来的伤害。更改网页背景色是不失为一种途径。与此同时,用户对于浏览器自定义的需求越来越强烈。网页颜色作为美化浏览器的组成部分,可最大程度满足用户的个性化定制要求。In the Internet era, more and more users use the browser to access the Internet. Web pages serve as the main browsing target for users to access the Internet. The white background color of most web pages creates a large stimulus to the user's eyes, which is prone to visual fatigue. It is easy for a user to face the screen for a long time to affect vision. In this case, a better solution is needed to mitigate the damage that the user has on the Internet for a long time. Changing the background color of a web page is a way. At the same time, users are increasingly demanding browser customization. The color of the web page is part of the beautification browser to best meet the user's personalized customization requirements.
目前,通常采用更改网页的透明度参数的方法实现对网页色彩的调整。但是,该方案存在较大弊端,一是灵活性不高,通过调整网页的透明度参数,无法实现对网页颜色的自由定义,例如,若当前网页呈现蓝色,而用户希望将网页调整至粉色,则通过调整网页透明度参数的方式无法实现;二是用户通过界面交互层面完成透明度参数的设置,设置方式不直观,用户较难把握转换效果,甚至会给用户带来明显的负体验。At present, the adjustment of the color of the webpage is usually implemented by changing the transparency parameter of the webpage. However, this solution has major drawbacks. First, the flexibility is not high. By adjusting the transparency parameters of the webpage, the definition of the color of the webpage cannot be freely defined. For example, if the current webpage is blue, and the user wants to adjust the webpage to pink, The method of adjusting the transparency parameter of the webpage cannot be implemented; the second is that the user completes the setting of the transparency parameter through the interface interaction layer, and the setting mode is not intuitive, and the user is more difficult to grasp the conversion effect, and even brings a significant negative experience to the user.
发明内容Summary of the invention
鉴于上述,本发明提出了一种调整网页内容颜色的方法及装置,利用该方法及装置,通过识别出网页元素,然后基于网页元素的明度值对网页元素的颜色进行调整,从而能够达到灵活地改变网页内容颜色的目的。In view of the above, the present invention provides a method and apparatus for adjusting the color of a webpage content, by which the webpage element is identified, and then the color of the webpage element is adjusted based on the brightness value of the webpage element, thereby achieving flexibility Change the color of the content of the web page.
根据本发明的一个方面,提供了一种调整网页内容颜色的方法,包括:在获取到 用于调整网页内容颜色的指令后,从待处理的网页中识别出待调整的网页元素,所述待调整的网页元素至少包括背景元素;获取各个所识别出的背景元素的明度值;以及基于预定的颜色调整规则以及所获取的各个背景元素的明度值,调整各个背景元素的颜色。According to an aspect of the present invention, a method for adjusting a color of a webpage content is provided, including: obtaining After the instruction for adjusting the color of the webpage content, the webpage element to be adjusted is identified from the webpage to be processed, the webpage element to be adjusted includes at least a background element; the brightness value of each identified background element is obtained; The color adjustment rules and the brightness values of the acquired background elements are adjusted to adjust the color of each background element.
在上述方面的一个或多个示例中,所述颜色调整规则包括多个明度值区间以及各个明度值区间对应的颜色调整目标色值,所述多个明度值区间的并集为[第一预定值,第二预定值],以及于预定的颜色调整规则以及所获取的各个背景元素的明度值,调整各个背景元素的颜色包括:确定所获取的各个背景元素的明度值所位于的明度值区间;以及将各个背景元素的颜色的色值调整为所确定出的明度值区间对应的颜色调整目标色值。In one or more examples of the above aspect, the color adjustment rule includes a plurality of brightness value intervals and a color adjustment target color value corresponding to each brightness value interval, and the union of the plurality of brightness value intervals is [first predetermined a value, a second predetermined value, and a predetermined color adjustment rule and a brightness value of each of the acquired background elements. Adjusting the color of each of the background elements includes: determining a brightness value interval in which the obtained brightness values of the respective background elements are located And adjusting the color value of the color of each background element to the color adjustment target color value corresponding to the determined brightness value interval.
在上述方面的一个或多个示例中,基于预定的颜色调整规则以及所获取的各个背景元素的明度值,调整各个背景元素的颜色还包括:在确定出所获取的各个背景元素中存在明度值不位于任一所述明度值区间的背景元素时,保持该背景元素的颜色不变。In one or more examples of the above aspect, adjusting the color of each of the background elements based on the predetermined color adjustment rule and the brightness value of each of the acquired background elements further includes: determining that the brightness value is not present in each of the acquired background elements When the background element of any of the brightness value intervals is located, the color of the background element is kept unchanged.
在上述方面的一个或多个示例中,在获取各个所识别出的背景元素的明度值之前,所述方法还包括:获取各个所识别出的背景元素的纯度值,以及,获取各个所识别出的背景元素的明度值包括:获取所识别出各个背景元素中纯度值小于第三预定值的背景元素的明度值。In one or more examples of the above aspects, before acquiring the brightness values of the respective identified background elements, the method further comprises: obtaining purity values of the respective identified background elements, and acquiring each identified The brightness value of the background element includes: obtaining a brightness value of the background element in which the purity value of each of the identified background elements is less than a third predetermined value.
在上述方面的一个或多个示例中,所述待调整网页元素还包括文字,以及,所述方法还包括:获取各个所识别出的文字的纯度值;以及在各个所识别出的文字中存在纯度值大于第四预定值的文字时,将该文字的颜色调整为预定文字色值。In one or more examples of the above aspect, the to-be-adjusted webpage element further includes text, and the method further includes: obtaining a purity value of each of the recognized characters; and presenting in each of the recognized texts When the purity value is greater than the fourth predetermined value, the color of the character is adjusted to a predetermined text color value.
在上述方面的一个或多个示例中,所述待调整网页元素还包括描边,所述颜色调整规则包括多个明度值区间以及各个明度值区间对应的颜色调整目标色值,所述多个明度值区间的并集为[第一预定值,第二预定值],以及,所述方法还包括:获取各个所识别出的描边的纯度值;以及在各个所识别出的描边中存在纯度值小于第五预定值的描边时,获取该描边的明度值,当该描边的明度值在预定范围时,将所述描边的颜色的色值调整为与所述描边的明度值对应的颜色调整目标色值。In one or more examples of the above aspect, the to-be-adjusted webpage element further includes a stroke, the color adjustment rule includes a plurality of brightness value intervals and color adjustment target color values corresponding to the respective brightness value intervals, the plurality of The union of the brightness value intervals is [first predetermined value, second predetermined value], and the method further comprises: obtaining purity values of the respective identified strokes; and presenting in each identified stroke When the purity value is less than the stroke of the fifth predetermined value, the brightness value of the stroke is obtained, and when the brightness value of the stroke is within the predetermined range, the color value of the color of the stroke is adjusted to be the same as the stroke The color corresponding to the brightness value adjusts the target color value.
在上述方面的一个或多个示例中,在所述颜色调整规则中,所述各个明度值区间对应的颜色调整目标色值的深浅与明度大小存在对应关系,所述对应关系为:明度值越大,颜色调整目标色值越浅。 In one or more examples of the above aspect, in the color adjustment rule, the depth of the color adjustment target color value corresponding to each brightness value interval has a correspondence relationship with the brightness size, and the correspondence relationship is: the brightness value is more Large, the color adjustment target color value is shallower.
根据本发明的另一方面,提供了一种调整网页内容颜色的装置,包括:网页元素识别单元,用于在获取到用于调整网页内容颜色的指令后,从待处理的网页中识别出待调整的网页元素,所述待调整的网页元素至少包括背景元素;明度值获取单元,用于获取各个所识别出的背景元素的明度值;以及颜色调整单元,用于基于预定的颜色调整规则以及所获取的各个背景元素的明度值,调整各个背景元素的颜色。According to another aspect of the present invention, an apparatus for adjusting a color of a webpage content is provided, comprising: a webpage element identification unit, configured to identify a to-be-processed webpage after obtaining an instruction for adjusting a color of a webpage content The adjusted webpage element, the webpage element to be adjusted includes at least a background element; a brightness value obtaining unit configured to acquire a brightness value of each of the identified background elements; and a color adjustment unit configured to adjust the rule based on the predetermined color and The brightness value of each background element obtained is adjusted to adjust the color of each background element.
在上述方面的一个或多个示例中,所述颜色调整规则包括多个明度值区间以及各个明度值区间对应的颜色调整目标色值,所述多个明度值区间的并集为[第一预定值,第二预定值],以及所述颜色调整单元包括明度区间确定模块和调整模块,所述颜色调整单元基于预定的颜色调整规则以及所获取的各个背景元素的明度值,调整各个背景元素的颜色包括:所述明度区间确定模块确定所获取的各个背景元素的明度值所位于的明度值区间;以及所述调整模块将各个背景元素的颜色的色值调整为所确定出的明度值区间对应的颜色调整目标色值。In one or more examples of the above aspect, the color adjustment rule includes a plurality of brightness value intervals and a color adjustment target color value corresponding to each brightness value interval, and the union of the plurality of brightness value intervals is [first predetermined a value, a second predetermined value, and the color adjustment unit includes a brightness interval determination module and an adjustment module, the color adjustment unit adjusting each of the background elements based on the predetermined color adjustment rule and the acquired brightness values of the respective background elements The color includes: the brightness interval determination module determines a brightness value interval in which the acquired brightness values of the respective background elements are located; and the adjustment module adjusts the color values of the colors of the respective background elements to the determined brightness value intervals. The color adjusts the target color value.
在上述方面的一个或多个示例中,所述颜色调整单元基于预定的颜色调整规则以及所获取的各个背景元素的明度值,调整各个背景元素的颜色还包括:在所述明度区间确定模块确定出所获取的各个背景元素中存在明度值不位于任一所述明度值区间的背景元素时,保持该背景元素的颜色不变。In one or more examples of the above aspect, the color adjustment unit adjusts the color of each of the background elements based on the predetermined color adjustment rule and the brightness value of each of the acquired background elements, further comprising: determining, by the brightness interval determination module When there is a background element in each of the acquired background elements whose brightness value is not located in any of the brightness value intervals, the color of the background element is kept unchanged.
在上述方面的一个或多个示例中,所述装置还包括:纯度值获取单元,在所述明度值获取单元获取各个所识别出的背景元素的明度值之前,In one or more examples of the above aspect, the apparatus further includes: a purity value acquisition unit, before the brightness value acquisition unit acquires the brightness values of the respective identified background elements,
所述纯度值获取单元获取各个所识别出的背景元素的纯度值,以及,The purity value acquisition unit acquires purity values of the respective identified background elements, and
所述明度值获取单元获取各个所识别出的背景元素的明度值包括:获取所识别出各个背景元素中纯度值小于第三预定值的背景元素的明度值。The obtaining the brightness value of each of the identified background elements by the brightness value obtaining unit includes: acquiring a brightness value of the background element in which the purity value of each of the background elements is less than a third predetermined value.
在上述方面的一个或多个示例中,所述待调整网页元素还包括文字,以及,所述纯度值获取单元获取各个所识别出的文字的纯度值;以及所述颜色调整单元在各个所识别出的文字中存在纯度值大于第四预定值的文字时,将该文字的颜色调整为预定文字色值。In one or more examples of the above aspect, the to-be-adjusted webpage element further includes a text, and the purity value acquisition unit acquires a purity value of each of the recognized characters; and the color adjustment unit identifies each When there is a character whose purity value is greater than the fourth predetermined value, the color of the character is adjusted to a predetermined character color value.
在上述方面的一个或多个示例中,所述待调整网页元素还包括描边,所述颜色调整规则包括多个明度值区间以及各个明度值区间对应的颜色调整目标色值,所述多个明度值区间的并集为[第一预定值,第二预定值],以及,所述方法还包括:所述纯度值获取单元获取各个所识别出的描边的纯度值;以及在各个所识别出的描边中存在纯 度值小于第五预定值的描边时,所述明度值获取单元获取该描边的明度值,当该描边的明度值在预定范围时,所述颜色调整单元将所述描边的颜色的色值调整为与所述描边的明度值对应的颜色调整目标色值。In one or more examples of the above aspect, the to-be-adjusted webpage element further includes a stroke, the color adjustment rule includes a plurality of brightness value intervals and color adjustment target color values corresponding to the respective brightness value intervals, the plurality of The union of the brightness value intervals is [the first predetermined value, the second predetermined value], and the method further includes: the purity value acquisition unit acquires the purity values of the respective identified strokes; and identifies each There is pure in the stroke When the degree value is less than the stroke of the fifth predetermined value, the brightness value acquisition unit acquires the brightness value of the stroke, and when the brightness value of the stroke is within the predetermined range, the color adjustment unit compares the color of the stroke The color value is adjusted to a color adjustment target color value corresponding to the brightness value of the stroke.
在上述方面的一个或多个示例中,在所述颜色调整规则中,所述各个明度值区间对应的颜色调整目标色值的深浅与明度大小存在对应关系,所述对应关系为:明度值越大,颜色调整目标色值越浅。In one or more examples of the above aspect, in the color adjustment rule, the depth of the color adjustment target color value corresponding to each brightness value interval has a correspondence relationship with the brightness size, and the correspondence relationship is: the brightness value is more Large, the color adjustment target color value is shallower.
根据本发明的另一方面,提供了一种终端设备,包括如上述多个示例中的任一个示例所述的装置。According to another aspect of the present invention, there is provided a terminal device comprising the apparatus as described in any one of the above examples.
根据本发明的另一方面,提供了一种终端设备,包括:存储器,用于存储指令;处理器,与所述存储器耦合,该处理器被配置为执行存储在所述存储器中的指令,其中,所述存储器中存储的指令以及所述处理器用于实现如上述调整网页内容颜色的方法的一个或多个实施例所述的方法。According to another aspect of the present invention, a terminal device is provided, comprising: a memory for storing instructions; a processor coupled to the memory, the processor being configured to execute instructions stored in the memory, wherein The instructions stored in the memory and the method described by the processor for implementing one or more embodiments of the method of adjusting the color of a web page content as described above.
根据本发明的另一方面,提供了一种具有处理器可执行的程序代码的计算机可读介质,所述程序代码使处理器执行下述步骤:According to another aspect of the present invention, a computer readable medium having program code executable by a processor, the program code causing a processor to perform the following steps:
在获取到用于调整网页内容颜色的指令后,从待处理的网页中识别出待调整的网页元素,所述待调整的网页元素至少包括背景元素;After the instruction for adjusting the color of the webpage content is obtained, the webpage element to be adjusted is identified from the webpage to be processed, and the webpage element to be adjusted includes at least a background element;
获取各个所识别出的背景元素的明度值;以及Obtaining the brightness values of each identified background element;
基于预定的颜色调整规则以及所获取的各个背景元素的明度值,调整各个背景元素的颜色。The color of each background element is adjusted based on predetermined color adjustment rules and the brightness values of the acquired various background elements.
利用上述方法及装置及终端设备,在接收到整网页内容颜色的指令后,识别出网页中的网页元素,然后根据网页背景元素的明度信息对网页的背景元素进行颜色调整,由于不同的明度信息对应有不同颜色值,明度不同的背景元素拥有不同的颜色值,能够使得页面背景颜色得到调整的同时,保证页面中的不同的背景元素能够拥有区别于其他背景元素的颜色值,不会出现整个页面背景混为一体的情况,使调整颜色后的页面背景更具有层次感、更和谐。本申请能够实现对网页颜色的自由定义,颜色调整的灵活性高,并且,该方法中通过预设的颜色调整规则以及各个背景元素的明度值实现对背景颜色的调整,设置方式直观,便于用户把握转换效果。By using the above method, device and terminal device, after receiving the instruction of the color of the entire webpage content, the webpage element in the webpage is identified, and then the background element of the webpage is color-adjusted according to the brightness information of the webpage background element, because different brightness information Corresponding to different color values, background elements with different brightness have different color values, which can make the background color of the page be adjusted, and ensure that different background elements in the page can have color values different from other background elements, and the whole will not appear. When the background of the page is mixed, the background of the page after adjusting the color is more layered and more harmonious. The application can realize the free definition of the color of the webpage, and the flexibility of the color adjustment is high, and the method adjusts the background color by the preset color adjustment rule and the brightness value of each background element, and the setting manner is intuitive and convenient for the user. Grasp the conversion effect.
为了实现上述以及相关目的,本发明的一个或多个方面包括后面将详细说明并在权利要求中特别指出的特征。下面的说明以及附图详细说明了本发明的某些示例性方 面。然而,这些方面指示的仅仅是可使用本发明的原理的各种方式中的一些方式。此外,本发明旨在包括所有这些方面以及它们的等同物。In order to achieve the above and related ends, one or more aspects of the present invention include the features which are described in detail below and particularly pointed out in the claims. The following description and the accompanying drawings illustrate some exemplary aspects of the invention. surface. However, these aspects are indicative of only some of the various ways in which the principles of the invention may be employed. Furthermore, the invention is intended to cover all such aspects and their equivalents.
附图说明DRAWINGS
根据下述参照附图进行的详细描述,本发明的上述和其他目的、特征和优点将变得更加显而易见。在附图中:The above and other objects, features and advantages of the present invention will become more apparent from the Detailed Description In the drawing:
图1A示出了根据本发明的实施例的调整网页内容颜色的方法的流程图;FIG. 1A illustrates a flow chart of a method of adjusting color of web page content in accordance with an embodiment of the present invention; FIG.
图1B示出了浏览器上设置的网页背景色选项的示意图;FIG. 1B shows a schematic diagram of a web page background color option set on a browser;
图2示出了根据本发明另一实施例的调整网页中背景元素颜色的方法的详细流程图;2 is a detailed flowchart showing a method of adjusting a color of a background element in a webpage according to another embodiment of the present invention;
图3示出了根据本发明另一实施例的调整网页中文字颜色的方法的详细流程图;3 is a detailed flowchart showing a method of adjusting the color of a text in a webpage according to another embodiment of the present invention;
图4示出了根据本发明另一实施例的调整网页中描边颜色的方法的详细流程图;4 is a detailed flowchart showing a method of adjusting a stroke color in a webpage according to another embodiment of the present invention;
图5示出了本发明的实施例的调整网页内容颜色的装置的方框示意图。Figure 5 is a block schematic diagram of an apparatus for adjusting the color of web page content in accordance with an embodiment of the present invention.
具体实施方式detailed description
下面描述本公开的各个方面。应该明白的是,本文的教导可以以多种多样形式具体体现,并且在本文中公开的任何具体结构、功能或两者仅仅是代表性的。基于本文的教导,本领域技术人员应该明白的是,本文所公开的一个方面可以独立于任何其它方面实现,并且这些方面中的两个或多个方面可以按照各种方式组合。例如,可以使用本文所阐述的任何数目的方面,实现装置或实践方法。另外,可以使用其它结构、功能、或除了本文所阐述的一个或多个方面之外或不是本文所阐述的一个或多个方面的结构和功能,实现这种装置或实践这种方法。此外,本文所描述的任何方面可以包括权利要求的至少一个元素。Various aspects of the disclosure are described below. It should be understood that the teachings herein may be embodied in a variety of forms and that any specific structure, function, or both disclosed herein are merely representative. Based on the teachings herein, one of ordinary skill in the art will appreciate that one aspect disclosed herein can be implemented independently of any other aspects, and two or more of these aspects can be combined in various ways. For example, an apparatus or a method of practice can be implemented using any number of the aspects set forth herein. In addition, such an apparatus may be implemented or practiced using other structures, functions, or structures and functions in addition to or in one or more aspects than those set forth herein. Furthermore, any aspect described herein can include at least one element of the claims.
下面将参照附图描述本发明的各个实施例。Various embodiments of the present invention will be described below with reference to the drawings.
图1A示出了根据本发明的实施例的调整网页内容颜色的方法的流程图。FIG. 1A shows a flow chart of a method of adjusting the color of a web page content in accordance with an embodiment of the present invention.
如图1A所示,在步骤S110,在获取到用于调整网页内容颜色的指令后,从待处理的网页中识别出待调整的网页元素,所述待调整的网页元素至少包括背景元素。As shown in FIG. 1A, in step S110, after the instruction for adjusting the color of the webpage content is acquired, the webpage element to be adjusted is identified from the webpage to be processed, and the webpage element to be adjusted includes at least a background element.
这里,用于调整网页内容颜色的指令是由用户选择浏览器上的“网页背景色”选 项而触发的。如图1B所示,浏览器上设置有多个网页背景色选项供用户选择,如“经典白”、“护眼绿”和“稚气粉”等,用户根据自身需求,可通过触控操作选择其中包含的某一种网页背景色。另外,还可以接收用户输入的所需颜色,获取用户调整网页内容颜色的指令,例如,若用户需要将网页内容调整至蓝色,可在执行调整网页内容颜色的终端中输入包含“蓝色”的指示内容,从而使终端获取与该指示内容相应的用于调整网页内容颜色的指令。也就是说,通过所述用于调整网页内容颜色的指令,能够获取网页内容待调整的颜色。Here, the instruction for adjusting the color of the webpage content is selected by the user to select the "web background color" on the browser. Triggered by the item. As shown in FIG. 1B, a plurality of web page background color options are set on the browser for the user to select, such as “classic white”, “eye green” and “childish powder”, etc., the user can select through touch operation according to his own needs. The background color of a web page contained in it. In addition, the user may also receive the required color input, and obtain an instruction for the user to adjust the color of the webpage content. For example, if the user needs to adjust the webpage content to blue, the input may include “blue” in the terminal that performs the color adjustment of the webpage content. Instructing the content, so that the terminal acquires an instruction for adjusting the color of the webpage content corresponding to the indicated content. That is to say, by the instruction for adjusting the color of the webpage content, the color of the webpage content to be adjusted can be acquired.
在本发明的一个示例中,所述网页内容由多种类型的网页元素组成,背景元素是网页元素的一种,这里的背景元素包括页面这各个内容块的背景,例如标题栏背景、正文背景、导航栏背景等,还包括输入框等网页元素。另外,所述网页内容通常还包括其他类型的网页元素,如文字、图片和描边等。In one example of the present invention, the webpage content is composed of a plurality of types of webpage elements, and the background element is one of webpage elements, where the background element includes a background of each content block of the page, such as a title bar background, a body background , navigation bar background, etc., also includes webpage elements such as input boxes. In addition, the webpage content usually includes other types of webpage elements such as text, pictures, and strokes.
接下来,在步骤S120,获取各个所识别出的背景元素的明度值。Next, in step S120, the brightness values of the respective identified background elements are acquired.
明度是色彩的三要素之一,指色彩的亮度或明度,能够表征颜色的深浅、明暗的变化。明度值度越高则表示色彩越亮。明度值用百分比例来表示,比例越大则色彩越亮,比例越低则色彩越暗。Brightness is one of the three elements of color, which refers to the brightness or brightness of a color, and can represent the shades of light, light and dark changes. The higher the brightness value, the brighter the color. The brightness value is expressed as a percentage. The larger the ratio, the brighter the color, and the lower the ratio, the darker the color.
在步骤S130,基于预定的颜色调整规则以及所获取的各个背景元素的明度值,调整各个背景元素的颜色。In step S130, the colors of the respective background elements are adjusted based on the predetermined color adjustment rule and the acquired brightness values of the respective background elements.
在本发明的一个示例中,所述颜色调整规则包括多个明度值区间以及各个明度值区间对应的颜色调整目标色值,所述多个明度值区间的并集为[第一预定值,第二预定值],以及基于预定的颜色调整规则以及所获取的各个背景元素的明度值,调整各个背景元素的颜色包括:确定所获取的各个背景元素的明度值所位于的明度值区间;以及将各个背景元素的颜色的色值调整为所确定出的明度值区间对应的颜色调整目标色值。In an example of the present invention, the color adjustment rule includes a plurality of brightness value intervals and color adjustment target color values corresponding to the respective brightness value intervals, and the union of the plurality of brightness value intervals is [first predetermined value, a predetermined value], and adjusting the color of each of the background elements based on the predetermined color adjustment rule and the brightness value of each of the acquired background elements, including: determining a brightness value interval in which the acquired brightness values of the respective background elements are located; The color value of the color of each background element is adjusted to the color adjustment target color value corresponding to the determined brightness value interval.
利用本实施例的方法,基于背景元素的明度区间来调整背景元素的颜色,使得页面中不同的背景元素在改变颜色到用户指定的颜色主题时,还能够保持自己的特性。本实施例的方法能够实现对网页颜色的自由定义,颜色调整的灵活性高,并且,该方法中通过预设的颜色调整规则以及各个背景元素的明度值实现对背景颜色的调整,设置方式直观,便于用户把握转换效果。With the method of the embodiment, the color of the background element is adjusted based on the brightness interval of the background element, so that different background elements in the page can maintain their own characteristics when changing the color to the color theme specified by the user. The method of the embodiment can realize the free definition of the color of the webpage, and the flexibility of the color adjustment is high, and the method adjusts the background color by the preset color adjustment rule and the brightness value of each background element, and the setting mode is intuitive. It is convenient for users to grasp the conversion effect.
另外,本实施例公开的方法中,根据背景元素的明度区间调整背景元素的颜色, 能够使明度不同的背景元素拥有不同的颜色值,使得页面背景颜色得到调整的同时,保证页面中的不同的背景元素能够拥有区别于其他背景元素的颜色值,不会出现整个页面背景混为一体的情况,使调整颜色后的页面背景更具有层次感、更和谐。In addition, in the method disclosed in this embodiment, the color of the background element is adjusted according to the brightness interval of the background element, It can make the background elements with different brightness have different color values, so that the background color of the page is adjusted, and the different background elements in the page can have the color values different from other background elements, and the entire background of the page will not be mixed. In the case, the background of the page after adjusting the color is more layered and more harmonious.
其中,在调整各个背景元素的明度值时,可根据各个背景元素的明度值,以及所述颜色调整规则中包含的各个明度值区间对应的颜色调整目标色值,确定各个背景元素对应的颜色调整目标色值,实现对各个背景元素的调整。在另一实施例中,还可以根据各个背景元素的纯度值进行筛选,只调整纯度符合条件的背景元素的颜色,这种情况下,获取所识别出的各个背景元素中纯度值小于第三预定值的背景元素的明度值,再根据获取到的各个背景元素的明度值对其进行颜色的调整,以使网页的颜色更鲜明美观。The color adjustment of each background element may be determined according to the brightness value of each background element and the color corresponding to each brightness value interval included in the color adjustment rule. The target color value is used to adjust the various background elements. In another embodiment, it is also possible to perform screening according to the purity value of each background element, and only adjust the color of the background element whose purity meets the condition. In this case, the purity value of each identified background element is less than the third predetermined. The brightness value of the background element of the value is adjusted according to the brightness value of each background element obtained, so that the color of the webpage is more vivid and beautiful.
图2示出了根据本发明的另一实施例的调整网页中背景元素颜色的方法的详细流程图。2 shows a detailed flow chart of a method of adjusting the color of a background element in a web page in accordance with another embodiment of the present invention.
当待调整的网页元素为背景元素时,如图2所示,首先,在步骤S210,获取背景元素的纯度值。When the webpage element to be adjusted is a background element, as shown in FIG. 2, first, in step S210, the purity value of the background element is acquired.
纯度通常是指色彩的鲜艳度。纯度越高则表示色彩越鲜艳。纯度值用百分比例来表示,比例越大则色彩纯度越高,比例越低则色彩的纯度就越低。Purity usually refers to the vividness of color. The higher the purity, the brighter the color. The purity value is expressed as a percentage. The higher the ratio, the higher the color purity, and the lower the ratio, the lower the purity of the color.
接下来,步骤S220,判断所述纯度值是否小于第三预定值;如果是,则进入步骤S230;否则流程结束,不对该背景元素进行处理,即保持所述背景元素的颜色不变。Next, in step S220, it is judged whether the purity value is smaller than the third predetermined value; if yes, the process proceeds to step S230; otherwise, the process ends, the background element is not processed, that is, the color of the background element is kept unchanged.
在本发明的一个示例中,所述第三预定值为5%。也就是说,当背景元素的纯度值小于5%时,才根据颜色调整规则和各背景元素的明度值调整背景元素的颜色,若背景元素的纯度值大于或等于5%,则保持背景元素的颜色不变。In one example of the invention, the third predetermined value is 5%. That is to say, when the purity value of the background element is less than 5%, the color of the background element is adjusted according to the color adjustment rule and the brightness value of each background element. If the purity value of the background element is greater than or equal to 5%, the background element is maintained. The color does not change.
步骤S230,获取所述背景元素的明度值。Step S230, acquiring a brightness value of the background element.
步骤S240,判断所述背景元素的明度值是否位于预定的任一明度值区间;如果是,则进入步骤S250,否则流程结束,不对所述背景元素进行处理,即保持所述背景元素的颜色不变。Step S240, determining whether the brightness value of the background element is located in any predetermined brightness value interval; if yes, proceeding to step S250, otherwise the process ends, the background element is not processed, that is, the color of the background element is not maintained. change.
在本发明的一个示例中,有多个明度区间,分别是(65%,80%]、(80%,90%]、(90%,96%]、(96%,100%]。也就是说,只有明度值大于65%的背景元素才有对应的明度区间。而明度值小于或等于65%的背景元素将不做处理。In one example of the present invention, there are a plurality of brightness intervals, which are (65%, 80%), (80%, 90%), (90%, 96%), (96%, 100%). It is said that only background elements with a brightness value greater than 65% have a corresponding brightness interval, while background elements with a brightness value less than or equal to 65% will not be processed.
最后,在步骤S250,确定所述背景元素的明度值所位于的明度值区间,将所述背 景元素的颜色的色值调整为所确定出的明度值区间对应的颜色调整目标色值。Finally, in step S250, determining a brightness value interval in which the brightness value of the background element is located, the back The color value of the color of the scene element is adjusted to the color adjustment target color value corresponding to the determined brightness value interval.
在本发明的一个示例中,所述各个明度值区间对应的颜色调整目标色值的深浅与明度大小存在对应关系,所述对应关系为:明度值越大,颜色调整目标色值越浅。明度值大的背景元素原本的颜色就较浅,所以调整时还是对于较浅的颜色。如图1B,所示,若获取到的所述用于调整网页内容颜色的指令表示需要将背景元素调整为“护眼绿”时,则将背景元素调整为绿色,并且,根据各个背景元素的明度值,以及所述颜色调整规则中包含的各个明度值区间和各个明度值区间对应的颜色调整目标色值,各个背景元素会被调整为深浅不同的绿色。In an example of the present invention, the depth of the color adjustment target color value corresponding to each brightness value interval has a corresponding relationship with the brightness, and the corresponding relationship is: the greater the brightness value, the lighter the color adjustment target color value. The background element with a large brightness value is originally lighter, so the adjustment is still for a lighter color. As shown in FIG. 1B, if the obtained instruction for adjusting the color of the webpage content indicates that the background element needs to be adjusted to "eye green", the background element is adjusted to green, and according to each background element The brightness value, and each brightness value interval included in the color adjustment rule and the color adjustment target color value corresponding to each brightness value interval, each background element is adjusted to a different shade of green.
另外,在对网页元素的颜色进行调整时,可根据用户需求将网页调整为不同的颜色,例如,“经典白”、“护眼绿”和“稚气粉”等。通过获取到的所述用于调整网页内容颜色的指令,即可确定本次调整操作中,网页元素需要被调整成的目标颜色。在所述颜色调整规则中,不同颜色下均包含有多个明度值区间,以及与各个明度值区间对应的颜色调整目标色值。例如,若需要将背景元素调整的目标颜色为绿色,则根据该目标颜色确定本次调整操作选用的是绿色所包含的多个明度值区间,以及与各个明度值区间对应的颜色调整目标色值,从而能够将背景的颜色调整为深浅不同的绿色。In addition, when the color of the webpage element is adjusted, the webpage can be adjusted to different colors according to the user's needs, for example, "classic white", "eye green" and "childish powder". By obtaining the instruction for adjusting the color of the webpage content, the target color that the webpage element needs to be adjusted in the adjustment operation can be determined. In the color adjustment rule, different colors include a plurality of brightness value intervals, and color adjustment target color values corresponding to the respective brightness value intervals. For example, if the target color to be adjusted by the background element is green, it is determined according to the target color that a plurality of brightness value intervals included in the green color and a color adjustment target color value corresponding to each brightness value interval are selected for the current adjustment operation. , so that the color of the background can be adjusted to a different shade of green.
在本发明的一个示例中,所述待调整网页元素还包括文字元素。图3示出了根据本发明的另一实施例的调整网页中文字颜色的方法的流程图。In an example of the present invention, the to-be-adjusted webpage element further includes a text element. FIG. 3 illustrates a flow chart of a method of adjusting the color of text in a web page in accordance with another embodiment of the present invention.
如图3所示,首先在步骤S310中,获取文字的纯度值。As shown in FIG. 3, first, in step S310, the purity value of the character is acquired.
接下来,在步骤S320,判断所述纯度值是否大于第四预定值;如果是,则进入步骤S330;否则流程结束,不对该文字进行处理,即保持所述文字的颜色不变。Next, in step S320, it is judged whether the purity value is greater than the fourth predetermined value; if yes, the process proceeds to step S330; otherwise, the process ends, the text is not processed, that is, the color of the character is kept unchanged.
在本发明的一个示例中,所述第四预定值为10%。In one example of the invention, the fourth predetermined value is 10%.
步骤S330,将所述文字的颜色调整为预定文字色值。Step S330, adjusting the color of the character to a predetermined text color value.
在本发明的一个示例中,所述待调整网页元素还包括描边。图4示出了根据本发明的另一实施例的调整网页中描边颜色的方法的流程图。In an example of the present invention, the to-be-adjusted webpage element further includes a stroke. 4 shows a flow chart of a method of adjusting the stroke color in a web page in accordance with another embodiment of the present invention.
如图4所示,首先在步骤S410中,获取描边的纯度值。As shown in FIG. 4, first, in step S410, the purity value of the stroke is obtained.
接下来,在步骤S420,判断所述纯度值是否小于第五预定值;如果是,则进入步骤S430,否则流程结束,不对该描边进行处理,即保持所述描边的颜色不变。Next, in step S420, it is judged whether the purity value is smaller than the fifth predetermined value; if yes, the process proceeds to step S430, otherwise the flow ends, and the stroke is not processed, that is, the color of the stroke is kept unchanged.
在本发明的一个示例中,所述第四预定值为12%。In one example of the invention, the fourth predetermined value is 12%.
步骤S430,获取所述描边的明度值。 Step S430, obtaining a brightness value of the stroke.
步骤S440,判断各个描边的明度值是否位于预定的任一明度值区间;如果是,则进入步骤S450,否则流程结束,不对该描边进行处理,即保持所述描边的颜色不变。在预定的颜色调整规则中,对描边这一网页元素制定了多个明度值区间,并规定了各个明度值区间分别对应的颜色调整目标色值。In step S440, it is determined whether the brightness value of each stroke is located in any predetermined brightness value interval; if yes, the process proceeds to step S450, otherwise the process ends, and the stroke is not processed, that is, the color of the stroke is kept unchanged. In the predetermined color adjustment rule, a plurality of brightness value intervals are defined for the page element of the stroke, and the color adjustment target color values corresponding to the respective brightness value intervals are specified.
在本发明的一个示例中,有多个明度区间,分别是(65%,75%]、(75%,100%]。也就是说,只有明度值大于65%的描边才有对应的明度区间。而明度值小于或等于65%的描边将不做处理。In an example of the present invention, there are a plurality of brightness intervals, which are (65%, 75%), (75%, 100%), that is, only a stroke having a brightness value greater than 65% has a corresponding brightness. Intervals. Strokes with a brightness value less than or equal to 65% will not be processed.
步骤S450,确定所述描边的明度值所位于的明度值区间,将所述描边的颜色的色值调整为所确定出的明度值区间对应的颜色调整目标色值。Step S450, determining a brightness value interval in which the brightness value of the stroke is located, and adjusting a color value of the color of the stroke to a color adjustment target color value corresponding to the determined brightness value interval.
在本发明的一个示例中,所述各个明度值区间对应的颜色调整目标色值的深浅与明度大小存在对应关系,所述对应关系为:明度值越大,颜色调整目标色值越浅。例如,若用于调整网页内容颜色的指令表示需要将背景元素调整为“稚气粉”,则将描边调整为粉色,并且,根据描边的明度值,以及颜色调整规则中包含的各个明度值区间和各个明度值区间对应的颜色调整目标色值,明度值不同的描边会被调整为深浅不同的粉色。In an example of the present invention, the depth of the color adjustment target color value corresponding to each brightness value interval has a corresponding relationship with the brightness, and the corresponding relationship is: the greater the brightness value, the lighter the color adjustment target color value. For example, if the instruction for adjusting the color of the webpage content indicates that the background element needs to be adjusted to "childish powder", the stroke is adjusted to pink, and according to the brightness value of the stroke, and the brightness values included in the color adjustment rule. The color adjustment target color value corresponding to the interval and each brightness value interval, and the strokes with different brightness values are adjusted to different shades of pink.
图5示出了根据本发明的实施例的调整网页内容颜色的装置的方框示意图。FIG. 5 shows a block schematic diagram of an apparatus for adjusting the color of a web page content in accordance with an embodiment of the present invention.
如图5所示,调整网页内容颜色的装置,包括网页元素识别单元510、明度值获取单元520、颜色调整单元530。As shown in FIG. 5, the device for adjusting the color of the webpage content includes a webpage element identification unit 510, a brightness value acquisition unit 520, and a color adjustment unit 530.
网页元素识别单元510用于在获取到用于调整网页内容颜色的指令后,从待处理的网页中识别出待调整的网页元素,所述待调整的网页元素至少包括背景元素;明度值获取单元520用于获取各个所识别出的背景元素的明度值;以及颜色调整单元530用于基于预定的颜色调整规则以及所获取的各个背景元素的明度值,调整各个背景元素的颜色。The webpage element identification unit 510 is configured to: after obtaining the instruction for adjusting the color of the webpage content, identify the webpage element to be adjusted from the webpage to be processed, where the webpage element to be adjusted includes at least a background element; the brightness value obtaining unit 520 is configured to obtain brightness values of the respective identified background elements; and the color adjustment unit 530 is configured to adjust colors of the respective background elements based on the predetermined color adjustment rules and the brightness values of the acquired respective background elements.
在本发明的一个示例中,所述颜色调整规则包括多个明度值区间以及各个明度值区间对应的颜色调整目标色值,所述多个明度值区间的并集为[第一预定值,第二预定值],以及所述颜色调整单元530包括明度区间确定模块和调整模块,所述颜色调整单元530基于预定的颜色调整规则以及所获取的各个背景元素的明度值,调整各个背景元素的颜色包括:所述明度区间确定模块确定所获取的各个背景元素的明度值所位于的明度值区间;以及所述调整模块将各个背景元素的颜色的色值调整为所确定出的明 度值区间对应的颜色调整目标色值。所述颜色调整单元基于预定的颜色调整规则以及所获取的各个背景元素的明度值,调整各个背景元素的颜色还包括:在所述明度区间确定模块确定出所获取的各个背景元素中存在明度值不位于任一所述明度值区间的背景元素时,保持该背景元素的颜色不变。In an example of the present invention, the color adjustment rule includes a plurality of brightness value intervals and color adjustment target color values corresponding to the respective brightness value intervals, and the union of the plurality of brightness value intervals is [first predetermined value, a second predetermined value], and the color adjustment unit 530 includes a brightness interval determination module and an adjustment module, and the color adjustment unit 530 adjusts the color of each background element based on a predetermined color adjustment rule and the acquired brightness values of the respective background elements. The method includes: the brightness interval determining module determines a brightness value interval in which the acquired brightness values of the respective background elements are located; and the adjusting module adjusts the color values of the colors of the respective background elements to the determined brightness The color corresponding to the degree interval adjusts the target color value. The color adjustment unit adjusts the color of each background element based on the predetermined color adjustment rule and the brightness value of each of the acquired background elements. The method further includes: determining, by the brightness interval determination module, that the brightness value is not present in each acquired background element. When the background element of any of the brightness value intervals is located, the color of the background element is kept unchanged.
在本发明的一个示例中,所述各个明度值区间对应的颜色调整目标色值的深浅与明度大小存在对应关系,所述对应关系为:明度值越大,颜色调整目标色值越浅。In an example of the present invention, the depth of the color adjustment target color value corresponding to each brightness value interval has a corresponding relationship with the brightness, and the corresponding relationship is: the greater the brightness value, the lighter the color adjustment target color value.
在本发明的一个示例中,所述调整网页内容颜色的装置还包括纯度值获取单元(图中未示出),在所述明度值获取单元获取各个所识别出的背景元素的明度值之前,所述纯度值获取单元获取各个所识别出的背景元素的纯度值,以及,所述明度值获取单元520获取各个所识别出的背景元素的明度值包括:获取所识别出各个背景元素中纯度值小于第三预定值的背景元素的明度值。In an example of the present invention, the means for adjusting the color of the webpage content further includes a purity value acquisition unit (not shown), before the brightness value acquisition unit acquires the brightness values of the respective identified background elements, The purity value acquisition unit acquires the purity value of each of the identified background elements, and the brightness value acquisition unit 520 acquires the brightness value of each of the identified background elements, including: obtaining the purity value of each identified background element A brightness value of a background element that is less than a third predetermined value.
在本发明的一个示例中,所述待调整网页元素还包括文字,以及,所述纯度值获取单元获取各个所识别出的文字的纯度值;以及所述颜色调整单元530在各个所识别出的文字中存在纯度值大于第四预定值的文字时,将该文字的颜色调整为预定文字色值。In an example of the present invention, the to-be-adjusted webpage element further includes a text, and the purity value acquisition unit acquires a purity value of each of the recognized characters; and the color adjustment unit 530 identifies each of the When there is a character whose purity value is greater than the fourth predetermined value in the character, the color of the character is adjusted to a predetermined character color value.
在本发明的一个示例中,所述待调整网页元素还包括描边,以及,所述方法还包括:所述纯度值获取单元获取各个所识别出的描边的纯度值;以及在各个所识别出的描边中存在纯度值小于第五预定值的描边时,所述明度值获取单元获取该描边的明度值,当该描边的明度值在预定范围时,所述颜色调整单元530将所述描边的颜色的色值调整为与所述描边的明度值对应的颜色调整目标色值。In an example of the present invention, the to-be-adjusted webpage element further includes a stroke, and the method further includes: the purity value acquisition unit acquires a purity value of each identified stroke; and identifies each When there is a stroke in the stroke of which the purity value is less than the fifth predetermined value, the brightness value acquisition unit acquires the brightness value of the stroke, and when the brightness value of the stroke is within the predetermined range, the color adjustment unit 530 The color value of the color of the stroke is adjusted to a color adjustment target color value corresponding to the brightness value of the stroke.
在本发明的一个示例中,一种终端设备,包括如图5所述的装置,也就是说,该终端设备包含以上所述的调整网页内容颜色的装置。In one example of the present invention, a terminal device includes the device as described in FIG. 5, that is, the terminal device includes the above-described means for adjusting the color of the web page content.
另外,本发明还公开一种终端设备,包括:存储器,用于存储指令;In addition, the present invention also discloses a terminal device, including: a memory, configured to store an instruction;
处理器,与所述存储器耦合,该处理器被配置为执行存储在所述存储器中的指令,其中,所述存储器中存储的指令以及所述处理器用于实现如图1至图4中任一实施例的方法。a processor coupled to the memory, the processor being configured to execute instructions stored in the memory, wherein the instructions stored in the memory and the processor are used to implement any of FIGS. 1 through 4 The method of the examples.
另外,本发明还公开一种具有处理器可执行的程序代码的计算机可读介质,所述程序代码使处理器执行下述步骤:Additionally, the present invention also discloses a computer readable medium having program code executable by a processor, the program code causing the processor to perform the following steps:
在获取到用于调整网页内容颜色的指令后,从待处理的网页中识别出待调整的网 页元素,所述待调整的网页元素至少包括背景元素;After obtaining the instruction for adjusting the color of the webpage content, identifying the web to be adjusted from the webpage to be processed a page element, the webpage element to be adjusted includes at least a background element;
获取各个所识别出的背景元素的明度值;以及Obtaining the brightness values of each identified background element;
基于预定的颜色调整规则以及所获取的各个背景元素的明度值,调整各个背景元素的颜色。The color of each background element is adjusted based on predetermined color adjustment rules and the brightness values of the acquired various background elements.
利用上述的方法、装置及终端设备,通过识别出网页中的网页元素,然后根据网页背景元素的明度信息对网页的背景元素进行颜色调整,由于不同的明度信息对应有不同颜色值,明度不同的背景元素拥有不同的颜色值,能够使得页面背景颜色得到调整的同时,保证页面中的不同的背景元素能够拥有区别于其他背景元素的颜色值,不会出现整个页面背景混为一体的情况。另外,对于页面中的各种不同页面元素,例如文字、图片等其他页面元素,分别基于元素特性对应有相应的颜色调整规则,使得整个页面的颜色调整效果更和谐,同时还保证页面清晰且具有层次感。By using the above method, device and terminal device, by identifying the webpage element in the webpage, and then performing color adjustment on the background element of the webpage according to the brightness information of the background element of the webpage, since different brightness information corresponds to different color values, the brightness is different. The background elements have different color values, which can make the background color of the page be adjusted, and ensure that different background elements in the page can have color values different from other background elements, and the entire page background does not appear to be integrated. In addition, for various page elements in the page, such as text, pictures and other page elements, corresponding color adjustment rules are respectively corresponding to the element characteristics, so that the color adjustment effect of the entire page is more harmonious, and the page is also clear and has Layering.
此外,根据本发明的方法还可以被实现为由移动终端中的处理器(比如CPU)执行的计算机程序,并且存储在移动终端的存储器中。在该计算机程序被处理器执行时,处理器执行本发明的方法中限定的上述功能。Furthermore, the method according to the invention can also be implemented as a computer program executed by a processor (such as a CPU) in a mobile terminal and stored in a memory of the mobile terminal. When the computer program is executed by a processor, the processor performs the functions described above in the method of the present invention.
此外,根据本发明的方法还可以实现为一种计算机程序产品,该计算机程序产品包括计算机可读介质,在该计算机可读介质上存储有用于执行本发明的方法中限定的上述功能的计算机程序。Furthermore, the method according to the invention may also be embodied as a computer program product comprising a computer readable medium on which is stored a computer program for performing the functions described above in the method of the invention. .
此外,上述方法步骤以及系统单元也可以利用控制器以及用于存储使得控制器实现上述步骤或单元功能的计算机程序的计算机可读存储设备实现。Furthermore, the method steps and system units described above may also be implemented with a controller and a computer readable storage device for storing a computer program that causes the controller to implement the steps or unit functions described above.
本领域技术人员还将明白的是,结合这里的公开所描述的各种示例性逻辑块、模块、电路和算法步骤可以被实现为电子硬件、计算机软件或两者的组合。为了清楚地说明硬件和软件的这种可互换性,已经就各种示意性组件、方块、模块、电路和步骤的功能对其进行了一般性的描述。这种功能是被实现为软件还是被实现为硬件取决于具体应用以及施加给整个系统的设计约束。本领域技术人员可以针对每种具体应用以各种方式来实现所述的功能,但是这种实现决定不应被解释为导致脱离本发明的范围。The various illustrative logical blocks, modules, circuits, and algorithm steps described in connection with the disclosure herein may be implemented as electronic hardware, computer software, or combinations of both. To clearly illustrate this interchangeability of hardware and software, various illustrative components, blocks, modules, circuits, and steps have been described. Whether such functionality is implemented as software or as hardware depends on the particular application and design constraints imposed on the overall system. A person skilled in the art can implement the described functions in various ways for each specific application, but such implementation decisions should not be construed as causing a departure from the scope of the invention.
尽管前面公开的内容示出了本发明的示例性实施例,但是应当注意,在不背离权利要求限定的本发明的范围的前提下,可以进行多种改变和修改。根据这里描述的发明实施例的方法权利要求的功能、步骤和/或动作不需以任何特定顺序执行。此外,尽管本发明的元素可以以个体形式描述或要求,但是也可以设想多个,除非明确限制为 单数。While the foregoing disclosure shows exemplary embodiments of the present invention, it should be understood that various changes and modifications may be made without departing from the scope of the invention. The functions, steps and/or actions of the method claims according to the embodiments of the invention described herein are not required to be performed in any particular order. Furthermore, although elements of the invention may be described or claimed in the form of an individual, a plurality may be envisaged, unless explicitly limited to Odd number.
虽然如上参照图描述了根据本发明的各个实施例进行了描述,但是本领域技术人员应当理解,对上述本发明所提出的各个实施例,还可以在不脱离本发明内容的基础上做出各种改进。因此,本发明的保护范围应当由所附的权利要求书的内容确定。 Although the description has been made in accordance with the various embodiments of the present invention as described above, those skilled in the art should understand that the various embodiments of the present invention described above may also be made without departing from the scope of the present invention. Improvements. Therefore, the scope of the invention should be determined by the content of the appended claims.

Claims (17)

  1. 一种调整网页内容颜色的方法,其特征在于,包括:A method for adjusting the color of a webpage content, comprising:
    在获取到用于调整网页内容颜色的指令后,从待处理的网页中识别出待调整的网页元素,所述待调整的网页元素至少包括背景元素;After the instruction for adjusting the color of the webpage content is obtained, the webpage element to be adjusted is identified from the webpage to be processed, and the webpage element to be adjusted includes at least a background element;
    获取各个所识别出的背景元素的明度值;以及Obtaining the brightness values of each identified background element;
    基于预定的颜色调整规则以及所获取的各个背景元素的明度值,调整各个背景元素的颜色。The color of each background element is adjusted based on predetermined color adjustment rules and the brightness values of the acquired various background elements.
  2. 如权利要求1所述的方法,其特征在于,所述颜色调整规则包括多个明度值区间以及各个明度值区间对应的颜色调整目标色值,所述多个明度值区间的并集为[第一预定值,第二预定值],以及The method according to claim 1, wherein the color adjustment rule comprises a plurality of brightness value intervals and a color adjustment target color value corresponding to each brightness value interval, and the union of the plurality of brightness value intervals is [ a predetermined value, a second predetermined value], and
    基于预定的颜色调整规则以及所获取的各个背景元素的明度值,调整各个背景元素的颜色包括:Adjusting the color of each background element based on the predetermined color adjustment rule and the brightness value of each of the acquired background elements includes:
    确定所获取的各个背景元素的明度值所位于的明度值区间;以及Determining the range of lightness values in which the brightness values of the acquired background elements are located;
    将各个背景元素的颜色的色值调整为所确定出的明度值区间对应的颜色调整目标色值。The color value of the color of each background element is adjusted to the color adjustment target color value corresponding to the determined brightness value interval.
  3. 如权利要求2所述的方法,其特征在于,基于预定的颜色调整规则以及所获取的各个背景元素的明度值,调整各个背景元素的颜色还包括:The method of claim 2, wherein adjusting the colors of the respective background elements based on the predetermined color adjustment rule and the brightness values of the acquired respective background elements further comprises:
    在确定出所获取的各个背景元素中存在明度值不位于任一所述明度值区间的背景元素时,保持该背景元素的颜色不变。When it is determined that there are background elements in the obtained background elements whose brightness values are not located in any of the brightness value intervals, the color of the background elements is kept unchanged.
  4. 如权利要求1所述的方法,其特征在于,在获取各个所识别出的背景元素的明度值之前,所述方法还包括:The method of claim 1 wherein prior to obtaining the brightness values of the respective identified background elements, the method further comprises:
    获取各个所识别出的背景元素的纯度值,以及,Obtaining the purity values of each identified background element, and,
    获取各个所识别出的背景元素的明度值包括:Obtaining the brightness values of each identified background element includes:
    获取所识别出各个背景元素中纯度值小于第三预定值的背景元素的明度值。Obtaining a brightness value of the background element in which each of the background elements has a purity value less than a third predetermined value.
  5. 如权利要求1所述的方法,其特征在于,所述待调整网页元素还包括文字,以及,所述方法还包括:The method of claim 1, wherein the to-be-adjusted webpage element further comprises text, and the method further comprises:
    获取各个所识别出的文字的纯度值;以及Obtaining the purity value of each recognized text;
    在各个所识别出的文字中存在纯度值大于第四预定值的文字时,将该文字的颜色调整为预定文字色值。 When there is a character whose purity value is greater than the fourth predetermined value among the recognized characters, the color of the character is adjusted to a predetermined character color value.
  6. 如权利要求1所述的方法,其特征在于,所述待调整网页元素还包括描边,所述颜色调整规则包括多个明度值区间以及各个明度值区间对应的颜色调整目标色值,所述多个明度值区间的并集为[第一预定值,第二预定值],以及,所述方法还包括:The method of claim 1, wherein the to-be-adjusted webpage element further comprises a stroke, the color adjustment rule comprising a plurality of brightness value intervals and a color adjustment target color value corresponding to each brightness value interval, The union of the plurality of brightness value intervals is [the first predetermined value, the second predetermined value], and the method further includes:
    获取各个所识别出的描边的纯度值;以及Obtaining the purity values of each identified stroke;
    在各个所识别出的描边中存在纯度值小于第五预定值的描边时,获取该描边的明度值,当该描边的明度值在预定范围时,将所述描边的颜色的色值调整为与所述描边的明度值对应的颜色调整目标色值。Obtaining a stroke value of the stroke when the stroke value of the purity value is less than the fifth predetermined value exists in each of the recognized strokes, and when the brightness value of the stroke is within a predetermined range, the color of the stroke is The color value is adjusted to a color adjustment target color value corresponding to the brightness value of the stroke.
  7. 如权利要求2所述的方法,其特征在于,在所述颜色调整规则中,所述各个明度值区间对应的颜色调整目标色值的深浅与明度大小存在对应关系,所述对应关系为:The method according to claim 2, wherein in the color adjustment rule, the depth of the color adjustment target color value corresponding to each brightness value interval has a corresponding relationship with the brightness, and the corresponding relationship is:
    明度值越大,颜色调整目标色值越浅。The larger the brightness value, the lighter the color adjustment target color value.
  8. 一种调整网页内容颜色的装置,其特征在于,包括:An apparatus for adjusting a color of a webpage content, comprising:
    网页元素识别单元,用于在获取到用于调整网页内容颜色的指令后,从待处理的网页中识别出待调整的网页元素,所述待调整的网页元素至少包括背景元素;a webpage element identifying unit, configured to identify a webpage element to be adjusted from the webpage to be processed after obtaining an instruction for adjusting a color of the webpage content, where the webpage element to be adjusted includes at least a background element;
    明度值获取单元,用于获取各个所识别出的背景元素的明度值;以及a brightness value obtaining unit, configured to obtain a brightness value of each identified background element;
    颜色调整单元,用于基于预定的颜色调整规则以及所获取的各个背景元素的明度值,调整各个背景元素的颜色。And a color adjustment unit configured to adjust colors of the respective background elements based on the predetermined color adjustment rule and the brightness values of the acquired respective background elements.
  9. 如权利要求8所述的装置,其特征在于,所述颜色调整规则包括多个明度值区间以及各个明度值区间对应的颜色调整目标色值,所述多个明度值区间的并集为[第一预定值,第二预定值],以及The device according to claim 8, wherein the color adjustment rule comprises a plurality of brightness value intervals and color adjustment target color values corresponding to the respective brightness value intervals, and the union of the plurality of brightness value intervals is [ a predetermined value, a second predetermined value], and
    所述颜色调整单元包括明度区间确定模块和调整模块,The color adjustment unit includes a brightness interval determination module and an adjustment module.
    所述颜色调整单元基于预定的颜色调整规则以及所获取的各个背景元素的明度值,调整各个背景元素的颜色包括:The color adjustment unit adjusts the colors of the respective background elements based on the predetermined color adjustment rule and the brightness values of the acquired respective background elements, including:
    所述明度区间确定模块确定所获取的各个背景元素的明度值所位于的明度值区间;以及The brightness interval determination module determines a brightness value interval in which the acquired brightness values of the respective background elements are located;
    所述调整模块将各个背景元素的颜色的色值调整为所确定出的明度值区间对应的颜色调整目标色值。The adjustment module adjusts a color value of a color of each background element to a color adjustment target color value corresponding to the determined brightness value interval.
  10. 如权利要求9所述的装置,其特征在于,所述颜色调整单元基于预定的颜色调整规则以及所获取的各个背景元素的明度值,调整各个背景元素的颜色还包括:The apparatus according to claim 9, wherein the color adjustment unit adjusts the color of each of the background elements based on the predetermined color adjustment rule and the brightness value of each of the acquired background elements, further comprising:
    在所述明度区间确定模块确定出所获取的各个背景元素中存在明度值不位于任一 所述明度值区间的背景元素时,保持该背景元素的颜色不变。The brightness interval determination module determines that the brightness value is not located in any of the acquired background elements When the background element of the brightness value interval is kept, the color of the background element is kept unchanged.
  11. 如权利要求8所述的装置,其特征在于,还包括:纯度值获取单元,The apparatus according to claim 8, further comprising: a purity value acquisition unit,
    在所述明度值获取单元获取各个所识别出的背景元素的明度值之前,Before the brightness value acquisition unit acquires the brightness values of the respective identified background elements,
    所述纯度值获取单元获取各个所识别出的背景元素的纯度值,以及,The purity value acquisition unit acquires purity values of the respective identified background elements, and
    所述明度值获取单元获取各个所识别出的背景元素的明度值包括:The brightness value acquisition unit obtains the brightness values of each of the identified background elements, including:
    获取所识别出各个背景元素中纯度值小于第三预定值的背景元素的明度值。Obtaining a brightness value of the background element in which each of the background elements has a purity value less than a third predetermined value.
  12. 如权利要求8所述的装置,其特征在于,所述待调整网页元素还包括文字,以及,The device according to claim 8, wherein the to-be-adjusted webpage element further comprises text, and
    所述纯度值获取单元获取各个所识别出的文字的纯度值;以及The purity value acquisition unit acquires a purity value of each of the recognized characters;
    所述颜色调整单元在各个所识别出的文字中存在纯度值大于第四预定值的文字时,将该文字的颜色调整为预定文字色值。When the color adjustment unit has a character whose purity value is greater than a fourth predetermined value among the recognized characters, the color of the character is adjusted to a predetermined character color value.
  13. 如权利要求8所述的装置,其特征在于,所述待调整网页元素还包括描边,所述颜色调整规则包括多个明度值区间以及各个明度值区间对应的颜色调整目标色值,所述多个明度值区间的并集为[第一预定值,第二预定值],以及,所述方法还包括:The device according to claim 8, wherein the to-be-adjusted webpage element further comprises a stroke, the color adjustment rule comprising a plurality of brightness value intervals and a color adjustment target color value corresponding to each brightness value interval, The union of the plurality of brightness value intervals is [the first predetermined value, the second predetermined value], and the method further includes:
    所述纯度值获取单元获取各个所识别出的描边的纯度值;以及The purity value acquisition unit acquires purity values of each of the identified strokes;
    在各个所识别出的描边中存在纯度值小于第五预定值的描边时,所述明度值获取单元获取该描边的明度值,当该描边的明度值在预定范围时,所述颜色调整单元将所述描边的颜色的色值调整为与所述描边的明度值对应的颜色调整目标色值。When there is a stroke in which the purity value is less than the fifth predetermined value in each of the recognized strokes, the brightness value acquisition unit acquires the brightness value of the stroke, and when the brightness value of the stroke is within a predetermined range, The color adjustment unit adjusts the color value of the color of the stroke to a color adjustment target color value corresponding to the brightness value of the stroke.
  14. 如权利要求9所述的方法,其特征在于,在所述颜色调整规则中,所述各个明度值区间对应的颜色调整目标色值的深浅与明度大小存在对应关系,所述对应关系为:The method according to claim 9, wherein in the color adjustment rule, the depth of the color adjustment target color value corresponding to each brightness value interval has a corresponding relationship with the brightness, and the corresponding relationship is:
    明度值越大,颜色调整目标色值越浅。The larger the brightness value, the lighter the color adjustment target color value.
  15. 一种终端设备,其特征在于,包括如权利要求8至14中任一项所述的装置。A terminal device, comprising the device according to any one of claims 8 to 14.
  16. 一种终端设备,其特征在于,包括:A terminal device, comprising:
    存储器,用于存储指令;a memory for storing instructions;
    处理器,与所述存储器耦合,该处理器被配置为执行存储在所述存储器中的指令,其中,所述存储器中存储的指令以及所述处理器用于实现如权利要求1至7中任一项所述的方法。 a processor coupled to the memory, the processor being configured to execute instructions stored in the memory, wherein the instructions stored in the memory and the processor are for implementing any of claims 1-7 The method described in the item.
  17. 一种具有处理器可执行的程序代码的计算机可读介质,其特征在于,所述程序代码使处理器执行下述步骤:A computer readable medium having processor-executable program code, the program code causing a processor to perform the steps of:
    在获取到用于调整网页内容颜色的指令后,从待处理的网页中识别出待调整的网页元素,所述待调整的网页元素至少包括背景元素;After the instruction for adjusting the color of the webpage content is obtained, the webpage element to be adjusted is identified from the webpage to be processed, and the webpage element to be adjusted includes at least a background element;
    获取各个所识别出的背景元素的明度值;以及Obtaining the brightness values of each identified background element;
    基于预定的颜色调整规则以及所获取的各个背景元素的明度值,调整各个背景元素的颜色。 The color of each background element is adjusted based on predetermined color adjustment rules and the brightness values of the acquired various background elements.
PCT/CN2015/086767 2014-09-03 2015-08-12 Method and device for adjusting colour of webpage content WO2016034031A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201410446070.X 2014-09-03
CN201410446070.XA CN105468617B (en) 2014-09-03 2014-09-03 Adjust the method and device of web page contents color

Publications (1)

Publication Number Publication Date
WO2016034031A1 true WO2016034031A1 (en) 2016-03-10

Family

ID=55439104

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2015/086767 WO2016034031A1 (en) 2014-09-03 2015-08-12 Method and device for adjusting colour of webpage content

Country Status (2)

Country Link
CN (1) CN105468617B (en)
WO (1) WO2016034031A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2021168675A1 (en) * 2020-02-26 2021-09-02 Boe Technology Group Co., Ltd. Computer-implemented method, apparatus, and computer-program product
CN117315172A (en) * 2023-09-22 2023-12-29 鲸数科技(北京)有限公司 Map page configuration method, map page configuration device, electronic equipment and computer readable medium

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109558195B (en) * 2018-11-12 2021-07-06 厦门欢乐逛科技股份有限公司 Font special effect adjusting method, medium, computer equipment and device
CN109859283B (en) * 2018-12-22 2024-01-09 Oppo广东移动通信有限公司 Color taking method, color taking device, electronic equipment and storable medium
CN111191424B (en) * 2019-12-31 2023-03-03 北京华为数字技术有限公司 Page color matching method and device, storage medium and chip
CN113157356A (en) * 2020-01-22 2021-07-23 阿里巴巴集团控股有限公司 Method and device for adjusting object color, electronic equipment and computer storage medium
CN113238829B (en) * 2021-06-07 2022-10-18 北京字节跳动网络技术有限公司 Background color generation method and device, electronic equipment and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102508861A (en) * 2011-09-30 2012-06-20 华为技术有限公司 Webpage color setting method, webpage browser and webpage server
CN103761098A (en) * 2014-01-23 2014-04-30 贝壳网际(北京)安全技术有限公司 Method and device for changing webpage skin and browser

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060221091A1 (en) * 2005-03-30 2006-10-05 Sbc Knowledge Ventures, L.P. System and method for providing a visual display element for a graphical browser interface
CN103903593B (en) * 2012-12-27 2017-02-22 腾讯科技(武汉)有限公司 Adjustment method of display background of page, and terminal

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102508861A (en) * 2011-09-30 2012-06-20 华为技术有限公司 Webpage color setting method, webpage browser and webpage server
CN103761098A (en) * 2014-01-23 2014-04-30 贝壳网际(北京)安全技术有限公司 Method and device for changing webpage skin and browser

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2021168675A1 (en) * 2020-02-26 2021-09-02 Boe Technology Group Co., Ltd. Computer-implemented method, apparatus, and computer-program product
CN117315172A (en) * 2023-09-22 2023-12-29 鲸数科技(北京)有限公司 Map page configuration method, map page configuration device, electronic equipment and computer readable medium
CN117315172B (en) * 2023-09-22 2024-04-12 鲸数科技(北京)有限公司 Map page configuration method, map page configuration device, electronic equipment and computer readable medium

Also Published As

Publication number Publication date
CN105468617B (en) 2019-02-15
CN105468617A (en) 2016-04-06

Similar Documents

Publication Publication Date Title
WO2016034031A1 (en) Method and device for adjusting colour of webpage content
US9665952B2 (en) Information processing method and electronic device
CN104618671B (en) A kind of information processing method and electronic equipment
KR101481684B1 (en) Icon generation method
CN104407795B (en) Display control method and display control unit
US11323676B2 (en) Image white balance processing system and method
US9147378B2 (en) Color selection interface
CN104076928B (en) A kind of method for adjusting text importing image
MX2012009334A (en) Method and device for generating user interface.
WO2016188262A1 (en) Method and device for desktop colour matching, terminal and computer storage medium
WO2017152762A1 (en) Interface color adjustment method and apparatus, and webpage color adjustment method and apparatus
CN106780635B (en) Picture adaptation method and system of intelligent terminal
WO2018072270A1 (en) Method and device for enhancing image display
US9025224B2 (en) Image-color-correcting method using a multitouch screen
CN107799093A (en) Adjust method, terminal and the computer-readable recording medium of screen luminance of terminal
CN107077830B (en) Screen brightness adjusting method suitable for unmanned aerial vehicle control end and unmanned aerial vehicle control end
WO2020220858A1 (en) Image processing method and apparatus, electronic device, and computer-readable storage medium
CN105744317A (en) Method for rapidly modifying display background
US20150249810A1 (en) Image processing apparatus and method, image processing system, and non-transitory computer readable medium
CN109859283A (en) One kind taking color method, takes color device, electronic equipment and can storage medium
EP3665644B1 (en) Image processing apparatus, method for processing image and computer-readable recording medium
CN109564751A (en) The automatic adjusting method of user interface
CN107408401A (en) The user's sliding block for simplifying adjustment for image
CN113282212A (en) Interface display method, interface display device and electronic equipment
CN109600515A (en) A kind of information processing method and electronic equipment

Legal Events

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

Ref document number: 15837234

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 15837234

Country of ref document: EP

Kind code of ref document: A1