CN106648579A - Method and system of native app switching between night mode and day mode - Google Patents

Method and system of native app switching between night mode and day mode Download PDF

Info

Publication number
CN106648579A
CN106648579A CN201610818686.4A CN201610818686A CN106648579A CN 106648579 A CN106648579 A CN 106648579A CN 201610818686 A CN201610818686 A CN 201610818686A CN 106648579 A CN106648579 A CN 106648579A
Authority
CN
China
Prior art keywords
night
day mode
colour
initial colour
initial
Prior art date
Legal status (The legal status 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 status listed.)
Pending
Application number
CN201610818686.4A
Other languages
Chinese (zh)
Inventor
周灏
银恭敬
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Liangkebang Information Technology Co Ltd
Original Assignee
Beijing Liangkebang Information Technology Co Ltd
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 Beijing Liangkebang Information Technology Co Ltd filed Critical Beijing Liangkebang Information Technology Co Ltd
Priority to CN201610818686.4A priority Critical patent/CN106648579A/en
Publication of CN106648579A publication Critical patent/CN106648579A/en
Pending legal-status Critical Current

Links

Classifications

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

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Optical Filters (AREA)

Abstract

The invention provides a method and system of a native app switching between a night mode and a day mode. According to the method of the native app switching between the night mode and the day mode, there is no need of control to change the colors of controls one by one, the operation is simple, and the work cost is sharply reduced. The method comprises the steps of 1, obtaining initial color values of all the controls; 2, when switching between the night mode and the day mode is needed, reversing the screened luminescence L of the initial color values, wherein the reversal is executed according to the formula (1), that is, L1=100%-L0 (1), the color before the reversal is L0, the new color value after the reversal is L1. The invention further provides a system.

Description

A kind of primary app switching nights and the method and system of day mode
Technical field
The present invention relates to the technical field of cell phone intelligent control, more particularly to a kind of primary app switching nights and mould in the daytime The method of formula, and the system of primary app switching nights and day mode.
Background technology
General way is the color that the control in manual configuration XML shows.Switching in the daytime or night pattern when Time goes to change the color of control one by one manually, but the problem of such way is, if interface is very more, then need The cost of maintenance is greatly increased.
For example, a text control is write in topology file, needs first to specify a color to this text control.Then When needing to switch textcolor, the control in code is needed to go to change the color of control.This seems out of question, but When unknown number purpose text control is increased in topology fileSo it is accomplished by constantly changing each text control The color of part.Or there was only text control in topology file, also button control is just more loaded down with trivial details.
Accordingly, it would be desirable to go the scheme for changing this loaded down with trivial details and unlimited increase job costs.
The content of the invention
To overcome the defect of prior art, the technical problem to be solved in the present invention to there is provided a kind of primary app and switch night Between and day mode method, its without the need for control go to change the color of control one by one, simple to operate, job costs are substantially reduced.
The technical scheme is that:This primary app switching nights and the method for day mode, the method includes following Step:
(1) the initial colour of all controls is obtained;
(2) when night is needed and day mode switches, by the brightness L of the initial colour for filtering out
Inverted, invert and performed according to formula (1):
L1=100%-L0 (1)
Wherein, the color before reversion is L0, and the new colour after reversion is L1.
The present invention by the way that the brightness L of the initial colour for filtering out is inverted, so as to without the need for control go to change control one by one The color of part, simple to operate, job costs are substantially reduced.
A kind of system for additionally providing primary app switching nights and day mode, the system includes:
Initial colour acquisition module, it configures to obtain the initial colour of all controls;
Screening module, it configures to filter out satisfactory initial colour from the initial colour of all controls;
Brightness reversal block, its configuration come when needing night and day mode to switch, by the initial color for filtering out The brightness L of value is inverted,
Reversion is performed according to formula (1):
L1=100%-L0 (1)
Wherein, the color before reversion is L0, and the new colour after reversion is L1.
Description of the drawings
Fig. 1 show the flow chart of the method for primary app switching nights of the invention and day mode.
Specific embodiment
As shown in figure 1, the method for this primary app switching night and day mode, the method is comprised the following steps:
(1) the initial colour of all controls is obtained;
(2) when night is needed and day mode switches, the brightness L of the initial colour for filtering out is inverted, Reversion is performed according to formula (1):
L1=100%-L0 (1)
Wherein, the color before reversion is L0, and the new colour after reversion is L1.
Each colour can be expressed as HSL values, i.e. form and aspect, saturation degree, brightness (English:Hue,Saturation, Lightness), diurnal pattern switches us and is concerned with L, i.e. brightness.
For example, originally L values are 15%, then the value after inverting is 85%, and L values original for another example are 90%, then after inverting Value is 10%.
The present invention by the way that the brightness L of the initial colour for filtering out is inverted, so as to without the need for control go to change control one by one The color of part, simple to operate, job costs are substantially reduced.
In addition, in the step (1), by traversal the initial colour of all controls is obtained.
In addition, in the step (2), the L values of the initial colour of screening are in [0%, 25%] ∪ [75%, 100%].Application People is by substantial amounts of test, it was demonstrated that brightness value L carries out inversion effect best in the two intervals.
It will appreciated by the skilled person that realizing that all or part of step in above-described embodiment method can be Related hardware is instructed to complete by program, described program can be stored in a computer read/write memory medium, The program upon execution, including each step of above-described embodiment method, and described storage medium can be:ROM/RAM, magnetic Dish, CD, storage card etc..Therefore, corresponding with the method for the present invention, the present invention also includes a kind of primary app switchings simultaneously Night and the system of day mode, the system is generally represented in the form of the functional module corresponding with each step of method.Use The system of the method, the system includes:
Initial colour acquisition module, it configures to obtain the initial colour of all controls;
Screening module, it configures to filter out satisfactory initial colour from the initial colour of all controls;
Brightness reversal block, its configuration come when needing night and day mode to switch, by the initial color for filtering out The brightness L of value is inverted,
Reversion is performed according to formula (1):
L1=100%-L0 (1)
Wherein, the color before reversion is L0, and the new colour after reversion is L1.
In addition, in the initial colour acquisition module, by traversal the initial colour of all controls is obtained.
In addition, in the screening module, the L values of the initial colour of screening are in [0%, 25%] ∪ [75%, 100%].
The above, is only presently preferred embodiments of the present invention, not makees any pro forma restriction to the present invention, it is every according to According to any simple modification, equivalent variations and modification that the technical spirit of the present invention is made to above example, still belong to the present invention The protection domain of technical scheme.

Claims (6)

1. a kind of method that primary app switches night and day mode, it is characterised in that:The method is comprised the following steps:
(1) the initial colour of all controls is obtained;
(2) when night is needed and day mode switches, the brightness L of the initial colour for filtering out is inverted, is inverted Performed according to formula (1):
L1=100%-L0 (1)
Wherein, the color before reversion is L0, and the new colour after reversion is L1.
2. the method that primary app according to claim 1 switches night and day mode, it is characterised in that:The step (1) in, the initial colour of all controls is obtained by traversal.
3. the method that primary app according to claim 2 switches night and day mode, it is characterised in that:The step (2) in, the L values of the initial colour of screening are in [0%, 25%] ∪ [75%, 100%].
4. the system that a kind of primary app switches night and day mode, it is characterised in that:The system includes:
Initial colour acquisition module, it configures to obtain the initial colour of all controls;
Screening module, it configures to filter out satisfactory initial colour from the initial colour of all controls;
Brightness reversal block, its configuration come when needing night and day mode to switch, by the initial colour for filtering out Brightness L is inverted,
Reversion is performed according to formula (1):
L1=100%-L0 (1)
Wherein, the color before reversion is L0, and the new colour after reversion is L1.
5. the system that primary app according to claim 4 switches night and day mode, it is characterised in that:It is described initial In colour acquisition module, the initial colour of all controls is obtained by traversal.
6. the system that primary app according to claim 5 switches night and day mode, it is characterised in that:The screening In module, the L values of the initial colour of screening are in [0%, 25%] ∪ [75%, 100%].
CN201610818686.4A 2016-09-12 2016-09-12 Method and system of native app switching between night mode and day mode Pending CN106648579A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610818686.4A CN106648579A (en) 2016-09-12 2016-09-12 Method and system of native app switching between night mode and day mode

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610818686.4A CN106648579A (en) 2016-09-12 2016-09-12 Method and system of native app switching between night mode and day mode

Publications (1)

Publication Number Publication Date
CN106648579A true CN106648579A (en) 2017-05-10

Family

ID=58851662

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610818686.4A Pending CN106648579A (en) 2016-09-12 2016-09-12 Method and system of native app switching between night mode and day mode

Country Status (1)

Country Link
CN (1) CN106648579A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103744942A (en) * 2013-12-31 2014-04-23 广州市动景计算机科技有限公司 Web browsing method, web browsing device and web browsing terminal device
US20140267362A1 (en) * 2013-03-15 2014-09-18 Apple Inc. Device, Method, and Graphical User Interface for Adjusting the Appearance of a Control
CN105549928A (en) * 2015-12-02 2016-05-04 广州阿里巴巴文学信息技术有限公司 Color matching method and device of display content
CN105701165A (en) * 2015-12-30 2016-06-22 广东欧珀移动通信有限公司 Browser mode switching method and switching device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140267362A1 (en) * 2013-03-15 2014-09-18 Apple Inc. Device, Method, and Graphical User Interface for Adjusting the Appearance of a Control
CN103744942A (en) * 2013-12-31 2014-04-23 广州市动景计算机科技有限公司 Web browsing method, web browsing device and web browsing terminal device
CN105549928A (en) * 2015-12-02 2016-05-04 广州阿里巴巴文学信息技术有限公司 Color matching method and device of display content
CN105701165A (en) * 2015-12-30 2016-06-22 广东欧珀移动通信有限公司 Browser mode switching method and switching device

Similar Documents

Publication Publication Date Title
CN105549928B (en) The color matching method and device of display content
CN102708542B (en) Generating edge masks for a deblocking filter
CN104850395B (en) interface display method and system
CN101577747A (en) Electronic device and method for changing color of shell thereof
CN105233498A (en) Game character staining method and device, user terminal and game system
CN105981380A (en) Method and apparatus for palette initialization and management
CN107958449A (en) A kind of image combining method and device
CN107391150A (en) The adaptive variation of mobile terminal topic tone and system
CN105718272B (en) A kind of method and terminal of terminal factory reset
CN104657698A (en) Method for encoding and decoding colored two-dimensional code capable of bearing multiple black and white two-dimensional codes
US20160352971A1 (en) Electronic device and image processing method
CN104239927A (en) Colored two-dimension code generating method and decoding method
CN103150169A (en) Icon adjusting method
CN106791063A (en) The method and mobile terminal of a kind of wallpaper switching
CN104978198A (en) Method and apparatus for configuring keyboard skin
CN106031142A (en) Method and apparatus for palette prediction and sharing in video coding
CN103295045B (en) One dazzles color logic variable color Quick Response Code and generation method thereof
CN105760917A (en) Three-dimensional code coding method and system
CN106652046B (en) Model dyeing method and device
CN106293758B (en) A kind of method and apparatus that Web application interface changes skin
CN106648579A (en) Method and system of native app switching between night mode and day mode
CN106547530A (en) A kind of interface processing method and device
CN106251382A (en) The switching of picture style, camera render the realization method and system updated with theme
CN103246502B (en) A kind of implementation method of pop-up window and system
CN110377390A (en) Image information processing method, device and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20170510