Method and device for updating view color of application interface, medium and electronic device
By inserting a color value conversion function in the application program, the view color of the application interface is directly updated locally, solving the problem of large workload and untimely updates when updating the view color value in the existing technology, and achieving fast and accurate view color updates .
Patent Information
- Application Number
- CN202011344454.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-11-25
- Publication Date
- 2025-02-21
- Estimated Expiration
- 2040-11-25
AI Technical Summary
The prior art works great when changing the application local view color value, and cannot update the view color value quickly and accurately.
By obtaining the view data of the application interface and its corresponding first color value, and inserting the color value conversion function before the color function according to the color conversion instruction, the color value conversion is performed to update the view color.
It realizes that the view color of the application interface is updated quickly and accurately without uploading the view color value to the server, reducing workload and improving update efficiency.
Smart Images

Figure CN112486610B_ABST
Abstract
Description
Background Art
[0002] With the development of the Internet, users' demand for personalized settings of the user interface of applications is becoming more and more common. In some cases, the color of the application needs to be changed to fit the actual scene. For example, during the Qingming Festival, the interface of the application is grayed out.
[0003] Generally, if you need to change the local view color value of an application, there are two solutions: (1) put the view color value of the application into the server to replace the color value, and then send it to the application for display; (2) write multiple color schemes locally in the application.
[0004] However, the above two solutions have a huge workload and cannot update the view color value quickly and accurately.
[0005] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present disclosure, and therefore may include information that does not constitute the prior art known to ordinary technicians in the field. Summary of the invention
[0006] The purpose of the present disclosure is to provide a method for updating the view color of an application interface, a device for updating the view color of an application interface, a computer-readable storage medium, and an electronic device, which can quickly update the view color of the application interface.
[0007] Other features and advantages of the present disclosure will become apparent from the following detailed description, or may be learned in part by the practice of the present disclosure.
[0008] According to a first aspect of the present disclosure, a method for updating the view color of an application interface is provided, comprising: obtaining view data of the application interface and a first color value corresponding to the view data, wherein the application includes a color function; obtaining a color conversion instruction, and inserting a color value conversion function before the color function according to the color conversion instruction; converting the first color value according to the color value conversion function to obtain a second color value; and the color function updating the color of the view according to the second color value.
[0009] In an exemplary embodiment of the present disclosure, based on the aforementioned scheme, an extraction function and a color value conversion function corresponding to the extraction function are called according to the color conversion instruction; the position of the color function is obtained, and the color value conversion function is inserted before the color function using the extraction function.
[0010] In an exemplary embodiment of the present disclosure, based on the above-mentioned solution, a grayed-out conversion instruction is provided, wherein the grayed-out conversion instruction is used to update the color of the view to gray.
[0011] In an exemplary embodiment of the present disclosure, based on the above-mentioned scheme, the first color value and the color value conversion formula corresponding to the color value conversion function are obtained; and the first color value is converted into a second color value according to the color value conversion formula.
[0012] In an exemplary embodiment of the present disclosure, based on the above-mentioned scheme, the color function receives the second color value, wherein the color function includes a color assignment algorithm; and assigns the second color value to the view according to the color assignment algorithm to update the color of the view.
[0013] In an exemplary embodiment of the present disclosure, based on the above scheme, the first color value and the second color value are in decimal or hexadecimal.
[0014] In an exemplary embodiment of the present disclosure, based on the aforementioned scheme, the first color value and the base corresponding to the first color value are obtained; the second color value and the base corresponding to the second color value are obtained; and the base corresponding to the first color value or the base of the second color value is uniformly converted.
[0015] According to a second aspect of the present disclosure, a device for updating the view color of an application interface is provided, comprising: a color value acquisition module, used to acquire view data of the application interface and a first color value corresponding to the view data, wherein the application includes a color function; an instruction acquisition module, used to acquire a color conversion instruction, and insert a color value conversion function before the color function according to the color conversion instruction; a color value conversion module, used to convert the first color value according to the color value conversion function to obtain a second color value. A color update module, used for the color function to update the color of the view according to the second color value.
[0016] According to a third aspect of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored. When the program is executed by a processor, the method for updating the view color of the application interface as described in the first aspect of the above embodiment is implemented.
[0017] According to a fourth aspect of the present disclosure, there is provided an electronic device, including:
[0018] Processor; and
[0019] A storage device is used to store one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors implement the method for updating the view color of the application interface as described in the first aspect of the above embodiment.
[0020] The technical solution provided by the embodiments of the present disclosure may have the following beneficial effects:
[0021] In a method for updating the view color of an application interface provided by an embodiment of the present disclosure, after obtaining the color value of the view of the application interface, a color value conversion function can be inserted before the color function according to the color conversion instruction, and the color value conversion can be performed according to the color value conversion function, and finally the view color can be updated according to the converted color value. In an embodiment of the present disclosure, the color value can be captured before the color function obtains the color value, and the color value can be converted according to the color value conversion function, so that the view color value does not need to be uploaded to the server for color value replacement, and the view color of the application interface can be updated quickly and accurately.
[0022] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] The drawings herein are incorporated into the specification and constitute a part of the specification, showing embodiments consistent with the present disclosure, and together with the specification, are used to explain the principles of the present disclosure. Obviously, the drawings described below are only some embodiments of the present disclosure, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. In the drawings:
[0024] Figure 1 A schematic diagram schematically shows an exemplary system architecture of a method for updating the view color of an application interface to which an embodiment of the present disclosure can be applied;
[0025] Figure 2 A flowchart schematically illustrates a method for updating the view color of an application interface in an exemplary embodiment of the present disclosure;
[0026] Figure 3 Schematically showing a flow chart of inserting a color value conversion function before a color function using an extraction function in an exemplary embodiment of the present disclosure;
[0027] Figure 4 A flowchart schematically illustrates how to convert a first color value into a second color value according to a color value conversion formula in an exemplary embodiment of the present disclosure;
[0028] Figure 5 A flowchart schematically illustrates updating the view color according to the color assignment algorithm in an exemplary embodiment of the present disclosure;
[0029] Figure 6 A flowchart schematically illustrates a unified conversion of bases corresponding to a first color value and a second color value in an exemplary embodiment of the present disclosure;
[0030] Figure 7 A schematic diagram schematically shows the composition of a device for updating the view color of an application interface in an exemplary embodiment of the present disclosure;
[0031] Figure 8 The structure diagram of a computer system suitable for implementing the electronic device of the exemplary embodiment of the present disclosure is schematically shown. DETAILED DESCRIPTION
[0032] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as being limited to the examples set forth herein; on the contrary, these embodiments are provided so that the present disclosure will be more comprehensive and complete, and the concept of the example embodiments will be fully conveyed to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In addition, the described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present disclosure. However, those skilled in the art will appreciate that the technical solutions of the present disclosure may be practiced without one or more of the specific details, or other methods, components, devices, steps, etc. may be adopted. In other cases, known structures, methods, devices, implementations, materials, or operations are not shown or described in detail to avoid blurring various aspects of the present disclosure.
[0033] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities may be implemented in software form, or these functional entities or parts of functional entities may be implemented in one or more software hardened modules, or these functional entities may be implemented in different networks and / or processor devices and / or microcontroller devices.
[0034] Figure 1 A schematic diagram showing an exemplary system architecture to which the method for updating the view color of an application interface according to an embodiment of the present disclosure can be applied is shown.
[0035] like Figure 1 As shown, the system architecture 1000 may include one or more of terminal devices 1001, 1002, 1003, a network 1004, and a server 1005. The network 1004 is used to provide a medium for communication links between the terminal devices 1001, 1002, 1003 and the server 1005. The network 1004 may include various connection types, such as wired, wireless communication links, or optical fiber cables, etc.
[0036] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. According to the implementation requirements, there may be any number of terminal devices, networks and servers. For example, the server 1005 may be a server cluster composed of multiple servers.
[0037] Users can use terminal devices 1001, 1002, 1003 to interact with server 1005 through network 1004 to receive or send messages, etc. Terminal devices 1001, 1002, 1003 can be various electronic devices with display screens, including but not limited to smart phones, tablet computers, portable computers, desktop computers, etc. In addition, server 1005 can be a server that provides various services.
[0038] In one embodiment, the executor of the method for updating the view color of the application interface disclosed in the present invention may be terminal devices 1001, 1002, and 1003. Terminal devices 1001, 1002, and 1003 may obtain the view data of the application interface sent by terminal devices 1001, 1002, and 1003 and the first color value corresponding to the view data. Terminal devices 1001, 1002, and 1003 may obtain the color conversion instruction sent by terminal devices 1001, 1002, and 1003 or server 1005, and process the view data of the application interface and the first color value corresponding to the view data according to the method for updating the view color of the application interface disclosed in the present invention, and then return the second color value obtained after processing to terminal devices 1001, 1002, and 1003.
[0039] The scheme for updating the view color of the application interface in the present disclosure can be applied to various applications or software. When replacing the color of the interface view of various applications or software, the scheme of the present disclosure can be used. For example, the interface color of a certain software on a mobile phone is replaced; another example is the page color of a mobile phone web page is replaced; another example is the software interface of a computer client is replaced. The present disclosure does not specifically limit the application scenario.
[0040] According to the method for updating the view color of the application interface provided in this exemplary embodiment, when the view data of the application interface and the first color value corresponding to the view data are obtained, a color value conversion function is inserted before the color function according to the color conversion instruction, and then the first color value is converted to a second color value according to the color value conversion function, so that the color function updates the color of the view according to the second color value. Figure 2 As shown, the method for updating the view color of the application interface may include the following steps:
[0041] S210: Acquire view data of an application interface and a first color value corresponding to the view data, wherein the application includes a color function;
[0042] S220: Obtain a color conversion instruction, and insert a color value conversion function before the color function according to the color conversion instruction;
[0043] S230: Convert the first color value according to a color value conversion function to obtain a second color value;
[0044] S240: The color function updates the color of the view according to the second color value.
[0045] In the method for updating the view color of the application interface provided in the present example embodiment, the color value can be captured before the color function obtains the color value, and the color value can be converted according to the color value conversion function, thereby eliminating the need to upload the view color value to the server for color value replacement, and the view color of the application interface can be updated quickly and accurately.
[0046] Next, steps S210 to S240 of the method for updating the view color of the application interface in this exemplary embodiment will be described in more detail with reference to the accompanying drawings and embodiments.
[0047] Step S210, obtaining view data of an application interface and a first color value corresponding to the view data, wherein the application includes a color function;
[0048] In an exemplary embodiment of the present disclosure, application software or applications are used in various application scenarios of the Internet. Application software or applications can use various programming languages that can be used, as well as a collection of applications compiled in various programming languages. Application software packages are a collection of programs designed to solve certain types of problems using computers, and are mostly used by users. There are many categories of application software, such as: office software, multimedia software, various analysis software, collaboration software, business software, etc. Application software or applications can be installed in different operating systems, such as: Android, iOS, RIM, Symbian, Windows, etc. The operating system can be installed in different devices such as various mobile terminals, and mobile terminals have developed a variety of application software and applications based on these open operating system platforms.
[0049] In an example embodiment of the present disclosure, application software and applications generally include an application interface. The software interface refers to the instruction part of the software that is specially designed for the operator to operate, use and feedback information. In the application software and applications, the color part includes the pictures and interface views sent by the server. The view may include the startup cover, the overall software framework, the software panel, the menu interface, the button interface, the label, the icon, the scroll bar, the menu column bar, and the status bar attribute interface, etc. These items can have the same or different view colors. In the scheme for updating the view color of the application interface of the present disclosure, the colors of all items in the above interface can be updated, or the color of a part thereof can be updated. The purpose of updating the view color of the application interface is that, on the one hand, it can enable users to perform personalized settings; on the other hand, the view color of the application software or application interface can be adjusted in real time according to the business scenario, so that the overall style of the application is more in line with the actual business scenario.
[0050] In an exemplary embodiment of the present disclosure, the interface of the above-mentioned application software or application program may include view data. Specifically, the startup cover, overall software framework, software panel, menu interface, button interface, label, icon, scroll bar, menu column bar, and status bar attribute interface of the application software or application program may include view data. The view data may include the style, color value, effect, position, etc. of the above-mentioned items.
[0051] In an exemplary embodiment of the present disclosure, various items corresponding to the interface of application software or application programs may correspond to different color values. The color value is the color value corresponding to a certain color in different color modes. The RGB color mode is usually the most commonly used. The color is a mixture of red, green, and blue. The color is defined by a symbol, which is composed of red, green, and blue values (RGB). The minimum value of each color is 0 and the maximum value is 255. For example, the value corresponding to red in the RGB color mode is (255, 0, 0); the value corresponding to green in the RGB color mode is (0, 255, 0); and the value corresponding to blue in the RGB color mode is (0, 0, 255).
[0052] In an exemplary embodiment of the present disclosure, the application software or application program can design multiple functions using various programming languages, and these functions can be used to perform different functions. Generally speaking, the application software or application program includes a color function, and the color function can assign a color to a specific item in the application software or application program according to the color value. For example, when the color value obtained by the color function is (0, 255, 0) in the RGB mode, the color function can adjust the specific item to green according to (0, 255, 0).
[0053] In an exemplary embodiment of the present disclosure, view data and a first color value corresponding to the view data may be obtained in an application software or application program. The first color value corresponding to the view data herein may be the first color value corresponding to the view data of each item of the interface of the application software or application program, or may be the first color value corresponding to the view data of the entire interface of the application software or application program. That is, there may be one or more first color values corresponding to the view data of the application software or application program. The scheme of the present disclosure does not impose any special limitation on the number of first color values, as long as the color value corresponding to the interface can be obtained and its color updated.
[0054] Step S220, obtaining a color conversion instruction, and inserting a color value conversion function before the color function according to the color conversion instruction;
[0055] In an example embodiment of the present disclosure, a color conversion instruction can be obtained, and the color conversion instruction is used to update the view color of the interface in the application software or application program. The color conversion instruction can be issued by the user of the application software or application program, that is, issued from the local of the application software or application program. Specifically, when designing the application software or application program, a color conversion instruction control can be reserved, and the color conversion instruction control can issue a color conversion instruction. The specific content of the color conversion instruction can be adjusted by the user, such as color value, range, etc.; the color conversion instruction can also be issued by the server side. In some application scenarios, it is necessary to update the interface of the application software or application program to a color that fits the scene. At this time, the server side can issue a color conversion instruction to directly update the interface color. The color conversion instruction can update the view color of part of the application interface or the view color of all the application interfaces.
[0056] In an exemplary embodiment of the present disclosure, a color value conversion function can convert the color values of multiple colors. For example, blue in an application software or application program can be updated to green, black to white, etc. according to user needs or business needs. A color conversion instruction may include a color value conversion function, that is, a color conversion function is carried in a color conversion instruction; or, a color conversion instruction may call a color value conversion function in a server, application software, and application program. The scheme of the present disclosure does not specifically limit the specific function of the color value conversion function, as long as the original color value can be converted into a target color value according to the color value conversion function.
[0057] In an exemplary embodiment of the present disclosure, a color value conversion function may be inserted before a color function according to a color conversion instruction. Specifically, when a color function assigns a color to a view of an interface of an application software or application program, the color value needs to be sent to the color function. When the view color of the interface of the application software or application program needs to be updated, the color value conversion function may be inserted before the color function according to the specific rules of the color conversion instruction. In other words, the color value conversion function may obtain the color value corresponding to the view of the interface of the application software or application program before the color function, so that the color value conversion function may adjust the view color value.
[0058] In an exemplary embodiment of the present disclosure, the color conversion instruction may call an extraction function and a color value conversion function corresponding to the extraction function, find the location of the color function in the application software or application program, and use the extraction function to insert the color value conversion function before the color function. Figure 3 As shown, using the extraction function to insert the color value conversion function before the color function may include the following steps S310-S320:
[0059] Step S310, calling the extraction function and the color value conversion function corresponding to the extraction function according to the color conversion instruction;
[0060] In an exemplary embodiment of the present disclosure, the extraction function can obtain the position of the color function and insert the color value conversion function corresponding to the extraction function before the color function. The extraction function can be set in the application software or application program, such as the application data of the application software or application program; it can also be set in the storage of the terminal, such as ROM; it can also be set in the server. When a color conversion instruction is received, the extraction function can be called at the above position, and the extraction function can carry the color value conversion function.
[0061] Step S320, obtaining the position of the color function, and using the extraction function to insert the color value conversion function before the color function.
[0062] In an exemplary embodiment of the present disclosure, after the extraction function and the color value conversion function are called according to the color conversion instruction, the color value conversion function can be inserted before the color function. Specifically, the calling function can capture the color value of the interface view before the color function obtains the color value. At this time, the color function cannot assign the color to the interface view according to the color value. The color value conversion function corresponding to the extraction function can obtain the color value of the interface view and further process it.
[0063] Through the above steps S1010 to S1020, the extraction function and the color value conversion function corresponding to the extraction function can be called according to the color function, and the color value conversion function can be inserted before the color function using the extraction function, so that the color value conversion function can receive and process the color value before the color function.
[0064] In an exemplary embodiment of the present disclosure, the extraction function may include a hook function. Before the system function calls the information to be processed, the hook program first captures the information and obtains control. At this time, the hook function can process (change) the execution behavior of the system function and can also force the end of the message transmission. Specifically, the hook function is a program for processing system information. By calling, the hook function can be loaded into the system.
[0065] In an example embodiment of the present disclosure, the color conversion instruction may include a gray conversion instruction. In some application scenarios, the view color of the application software or application interface needs to be updated to gray. For example, during the Qingming Festival, the color of the interface view needs to be changed to gray to match the festive atmosphere. At this time, a gray conversion instruction may be issued locally or by the server to update the view color to gray. Gray may include dark gray and light gray, for example, (128, 128, 128) in the RGB color mode. The present disclosure does not specifically limit the specific color value of gray.
[0066] Step S230, converting the first color value according to a color value conversion function to obtain a second color value;
[0067] In an exemplary embodiment of the present disclosure, after a color value conversion function is inserted before a color function according to a color conversion instruction, at this time, the color value conversion function can obtain a first color value and convert the first color value into a second color value. Specifically, the first color value can be converted into a second color value corresponding to the color conversion instruction according to the color value conversion function. For example, if the color conversion instruction is a blue conversion instruction, the blue conversion instruction can call and obtain a blue color value conversion function, and insert the blue color value conversion function before the color function, then the blue color value conversion function can obtain the first color value and convert the first color value into a blue color value. The color value conversion function can be used to convert the obtained color value into a target color value.
[0068] In an exemplary embodiment of the present disclosure, the color value conversion function may include a color value conversion formula. After the first color value is obtained, the color value conversion formula may be used to convert the first color value into a second color value. Figure 4 As shown, converting the first color value into the second color value according to the color value conversion formula may include the following steps S410-S420:
[0069] Step S410: Obtaining a first color value and a color value conversion formula corresponding to a color value conversion function;
[0070] In an exemplary embodiment of the present disclosure, a color value conversion formula corresponds to the color value conversion function, the color value conversion function may carry the color value conversion formula, and the color value conversion formula may also be set in the application software or application program, such as in the application data of the application software or application program; may also be set in the storage of the terminal, such as in the ROM; may also be set in the server. The color value conversion function may call the color value conversion formula at the above location.
[0071] Step S420: converting the first color value into a second color value according to a color value conversion formula.
[0072] In an exemplary embodiment of the present disclosure, a color value conversion formula can convert a first color value into a second color value. The color value conversion formula may include a conversion factor, and the second color value can be obtained by multiplying the first color value by the conversion factor. Specifically, in the RGB color mode, the first color value (RGB) 1 includes a first blue color value B1, a first green color value G1, and a first red color value R1, and the color value conversion formula includes a blue conversion factor C B , Green conversion factor C G , Red conversion factor C R ,
[0073] The first blue color value and the blue conversion factor, the first green color value and the green conversion factor, the first red color value and the red conversion factor are multiplied, and then added to obtain the second blue color value B2, the second green color value G2 and the second red color value R2 corresponding to the second color value (RGB) 2. The specific expression is as follows:
[0074] (RGB)2=(B1*C B , R1*C R +G1*C G +B1*C B , B1*C B , R1*C R +G1*C G +B1*C B ,
[0075] R1*C R +G1*C G +B1*C B )
[0076] For example, when the color conversion instruction is a gray conversion instruction, the blue conversion factor C of the gray conversion formula corresponding to the gray conversion instruction is B =0.114, green conversion factor C G =0.587, red conversion factor C R =0.299, that is, the gray conversion formula is:
[0077] (RGB)2=(R1*0.299+G1*0.587+B1*0.114, R1*0.299+G1*0.587+B1*0.114,
[0078] R1*0.299+G1*0.587+B1*0.114)
[0079] It should be noted that the above conversion factors can be converted. For example, the conversion factors can be scaled 1000 times to implement integer operation algorithms. Scaling 1000 times can avoid low-speed floating-point operations. The conversion factors can also be scaled by integer powers of 2. Scaling by an integer of 2 can increase the operation speed.
[0080] In addition, a gray conversion formula with relatively low precision can also be used, but the operation speed is fast. Specifically, the first blue color value B1, the first green color value G1, and the first red color value R1 can be added, and the added value can be divided by 3 to perform graying. The expression is as follows:
[0081]
[0082] Step S240: The color function updates the color of the view according to the second color value.
[0083] In an exemplary embodiment of the present disclosure, after converting the first color value into the second color value according to the color value conversion function, the color function can obtain the second color value and replace the color corresponding to the second color value for the view of the application software or application interface, thereby completing the update of the view color.
[0084] In an exemplary embodiment of the present disclosure, through the above steps S210 to S240, the color value can be captured before the color function obtains the color value, and the color value can be converted according to the color value conversion function, so that there is no need to upload the view color value to the server for color value replacement, and the view color of the application interface can be updated quickly and accurately.
[0085] In an exemplary embodiment of the present disclosure, after the color function obtains the second color value, the second color value may be assigned to the view through a color assignment algorithm. Figure 5 As shown, updating the view color according to the color assignment algorithm may include the following steps S510 to S520:
[0086] Step S510: The color function receives the second color value, wherein the color function includes a color assignment algorithm;
[0087] In an exemplary embodiment of the present disclosure, the color function includes a color assignment algorithm, which may include algorithms designed in various programming languages for assigning colors to items. For example, in C# language, int v = Color.Red.ToArgb(); Color c = Color.FromArgb(v) may be used to assign colors; in Java language, System.out.println() may be used to assign colors. The present disclosure does not specifically limit the specific form of the color assignment algorithm, as long as it can perform color assignment.
[0088] Step S520: assigning a second color value to the view according to a color assignment algorithm to update the color of the view.
[0089] In an exemplary embodiment of the present disclosure, through the above steps S510 to S520, after the color function obtains the second color value, the second color value can be assigned to the view of the interface through the color assignment algorithm to achieve the purpose of updating the view color.
[0090] In an exemplary embodiment of the present disclosure, the first color value and the second color value may include a blue color value, a green color value, and a red color value, and the first color value and the second color value may include a blue color value, a green color value, and a red color value, and these color values can be represented in decimal or hexadecimal. Specifically, when using hexadecimal to represent the color value, a six-digit hexadecimal number can be used for representation. For example: FF0000 can represent red, wherein the six-digit hexadecimal number represents red, green, and blue in the RGB color mode in pairs, and in form: RRGGBB. It should be noted that the representation of the hexadecimal RGB color mode in different programming languages is not completely consistent. For example, in Visual basic 6.0, the hexadecimal RGB color can be represented as &HBBGGRR&. At the same time, the representation under the decimal RGB color mode is represented by a nine-digit decimal number, for example: the decimal RGB color of white is represented as (255, 255, 255), and the decimal RGB color of black RGB is represented as (0, 0, 0).
[0091] In an exemplary embodiment of the present disclosure, after obtaining the bases corresponding to the first color value and the second color value, the bases corresponding to the first color value and the second color value may be uniformly converted. Figure 6 As shown, performing unified conversion on the bases corresponding to the first color value and the second color value may include the following steps S610 to S630:
[0092] Step S610: Obtain a first color value and a base system corresponding to the first color value;
[0093] In an exemplary embodiment of the present disclosure, the view data of the application interface and the first color value corresponding to the view data may include a decimal RGB color mode or a hexadecimal RGB color mode. When the first color value is obtained, it can be detected whether the RGB color mode corresponding to the first color value is decimal or hexadecimal.
[0094] Step S620: Obtain the second color value and the base system corresponding to the second color value;
[0095] In an exemplary embodiment of the present disclosure, after converting the first color value into the second color value through a color value conversion function, the second color value can be obtained, and the RGB color mode corresponding to the first color value is detected to be decimal or hexadecimal.
[0096] Step S630: uniformly convert the base number corresponding to the first color value or the base number corresponding to the second color value.
[0097] In an exemplary embodiment of the present disclosure, when the RGB color mode system corresponding to the first color value and the second color value is obtained, the RGB color mode system of the first color value and the second color value can be uniformly converted. Specifically, the two corresponding bits (hexadecimal) in the hexadecimal RGB color mode can be converted into decimal to obtain the color value of the decimal RGB color mode. For example, when converting the hexadecimal RGB color mode 0000FF to a decimal RGB color, 00 (hexadecimal, red) can be converted to 0 (decimal, red), 00 (hexadecimal, green) can be converted to 0 (decimal, green), and FF (hexadecimal, blue) can be converted to 255 (decimal, blue), that is, the color value of the decimal RGB color mode obtained is (0, 0, 255).
[0098] In an exemplary embodiment of the present disclosure, through the above steps S610 to S620, the bases corresponding to the first color value and the second color value can be uniformly converted to facilitate the updating process of the color function.
[0099] It should be noted that the above figures are only schematic illustrations of the processes included in the method according to the exemplary embodiments of the present disclosure, and are not intended to be limiting. It is easy to understand that the processes shown in the above figures do not indicate or limit the time sequence of these processes. In addition, it is also easy to understand that these processes can be performed synchronously or asynchronously, for example, in multiple modules.
[0100] In addition, in an exemplary embodiment of the present disclosure, a device for updating the view color of an application interface is also provided. Figure 7 As shown, a device 700 for updating the view color of an application interface includes: a color value acquisition module 710 , an instruction acquisition module 720 , a color value conversion module 730 , and a color update module 740 .
[0101] Among them, the color value acquisition module is used to obtain the view data of the application interface and the first color value corresponding to the view data, wherein the application includes a color function; the instruction acquisition module is used to obtain the color conversion instruction and insert the color value conversion function before the color function according to the color conversion instruction; the color value conversion module is used to convert the first color value according to the color value conversion function to obtain the second color value. The color update module is used for the color function to update the color of the view according to the second color value.
[0102] In an exemplary embodiment of the present disclosure, based on the aforementioned scheme, an extraction function and a color value conversion function corresponding to the extraction function are called according to a color conversion instruction; the position of the color function is obtained, and the color value conversion function is inserted before the color function using the extraction function.
[0103] In an exemplary embodiment of the present disclosure, based on the above-mentioned solution, a grayed-out conversion instruction is used to update the color of the view to gray.
[0104] In an exemplary embodiment of the present disclosure, based on the above-mentioned scheme, a first color value and a color value conversion formula corresponding to a color value conversion function are obtained; and the first color value is converted into a second color value according to the color value conversion formula.
[0105] In an exemplary embodiment of the present disclosure, based on the above solution, a color function receives a second color value, wherein the color function includes a color assignment algorithm; and the second color value is assigned to the view according to the color assignment algorithm to update the color of the view.
[0106] In an exemplary embodiment of the present disclosure, based on the above scheme, the first color value and the second color value are in decimal or hexadecimal.
[0107] In an exemplary embodiment of the present disclosure, based on the above-mentioned scheme, a first color value and a base corresponding to the first color value are obtained; a second color value and a base corresponding to the second color value are obtained; and the base corresponding to the first color value or the base of the second color value is uniformly converted.
[0108] Since the various functional modules of the device for updating the view color of the application interface in the example embodiment of the present disclosure correspond to the steps of the example embodiment of the method for updating the view color of the application interface mentioned above, for details not disclosed in the device embodiment of the present disclosure, please refer to the embodiment of the method for updating the view color of the application interface mentioned above in the present disclosure.
[0109] It should be noted that, although several modules or units of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into multiple modules or units to be embodied.
[0110] In addition, in an exemplary embodiment of the present disclosure, an electronic device capable of implementing the above-mentioned method for updating the view color of the application interface is also provided.
[0111] Those skilled in the art will appreciate that various aspects of the present disclosure may be implemented as systems, methods or program products. Therefore, various aspects of the present disclosure may be specifically implemented in the following forms, namely: complete hardware embodiments, complete software embodiments (including firmware, microcode, etc.), or embodiments combining hardware and software aspects, which may be collectively referred to herein as "circuits", "modules" or "systems".
[0112] Refer to the following Figure 8 800 according to this embodiment of the present disclosure is described. Figure 8 The electronic device 800 shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0113] like Figure 8 As shown, the electronic device 800 is in the form of a general computing device. The components of the electronic device 800 may include, but are not limited to: the at least one processing unit 810, the at least one storage unit 820, a bus 830 connecting different system components (including the storage unit 820 and the processing unit 810), and a display unit 840.
[0114] The storage unit stores program codes, which can be executed by the processing unit 810, so that the processing unit 810 performs the steps according to various exemplary embodiments of the present disclosure described in the above “Exemplary Method” section of this specification. For example, the processing unit 810 can perform the following steps: Figure 2 In step S210 shown in the figure, view data of the application interface and a first color value corresponding to the view data are obtained, wherein the application includes a color function; in step S220, a color conversion instruction is obtained, and a color value conversion function is inserted before the color function according to the color conversion instruction; in step S230, the first color value is converted according to the color value conversion function to obtain a second color value; in step S240, the color function updates the color of the view according to the second color value.
[0115] For example, electronic devices can achieve Figure 2 The steps shown.
[0116] The storage unit 820 may include a readable medium in the form of a volatile storage unit, such as a random access memory unit (RAM) 821 and / or a cache memory unit 822 , and may further include a read-only memory unit (ROM) 823 .
[0117] The storage unit 820 may also include a program / utility 824 having a set (at least one) of program modules 825, such program modules 825 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.
[0118] Bus 830 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
[0119] The electronic device 800 may also communicate with one or more external devices 870 (e.g., keyboards, pointing devices, Bluetooth devices, etc.), may also communicate with one or more devices that enable a user to interact with the electronic device 800, and / or communicate with any device that enables the electronic device 800 to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed via an input / output (I / O) interface 850. Furthermore, the electronic device 800 may also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) via a network adapter 860. As shown, the network adapter 860 communicates with other modules of the electronic device 800 via a bus 830. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 800, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, etc.
[0120] Through the description of the above embodiments, it is easy for those skilled in the art to understand that the example embodiments described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the embodiment of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the embodiment of the present disclosure.
[0121] In an exemplary embodiment of the present disclosure, a computer-readable storage medium is also provided, on which a program product capable of implementing the above method of the present specification is stored. In some possible embodiments, various aspects of the present disclosure can also be implemented in the form of a program product, which includes a program code. When the program product is run on a terminal device, the program code is used to enable the terminal device to execute the steps according to various exemplary embodiments of the present disclosure described in the above "Exemplary Method" section of the present specification.
[0122] Computer readable signal media may include data signals propagated in baseband or as part of a carrier wave, in which readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Readable signal media may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0123] The program code embodied on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the foregoing.
[0124] Program code for performing the operations of the present disclosure may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., through the Internet using an Internet service provider).
[0125] In addition, the above-mentioned figures are only schematic illustrations of the processes included in the method according to the exemplary embodiments of the present disclosure, and are not intended to be limiting. It is easy to understand that the processes shown in the above-mentioned figures do not indicate or limit the time sequence of these processes. In addition, it is also easy to understand that these processes can be performed synchronously or asynchronously, for example, in multiple modules.
[0126] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary technical means in the art that are not disclosed in the present disclosure. The specification and examples are to be considered as exemplary only, and the true scope and spirit of the present disclosure are indicated by the claims.
[0127] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims
1. A method for updating the view color of an application interface, characterized in that: include: Acquire view data of an application interface and a first color value corresponding to the view data, wherein the application includes a color function; Obtaining a color conversion instruction, and inserting a color value conversion function before the color function according to the color conversion instruction, including: calling an extraction function and a color value conversion function corresponding to the extraction function according to the color conversion instruction; obtaining a position of the color function, and inserting the color value conversion function before the color function using the extraction function; Converting the first color value to obtain a second color value according to the color value conversion function includes: obtaining the first color value and a color value conversion formula corresponding to the color value conversion function; converting the first color value to a second color value according to the color value conversion formula, wherein the color value conversion formula includes a conversion factor, and multiplying the first color value by the conversion factor to obtain the second color value; The color function updates the color of the view according to the second color value.
2. The method according to claim 1, characterized in that The color conversion instruction includes: A gray conversion instruction, wherein the gray conversion instruction is used to update the color of the view to gray.
3. The method according to claim 1, characterized in that The color function updates the color of the view according to the second color value, including: The color function receives the second color value, wherein the color function includes a color assignment algorithm; The second color value is assigned to the view according to the color assignment algorithm to update the color of the view.
4. The method according to claim 1, characterized in that The first color value and the second color value include: the first color value and the second color value are in decimal or hexadecimal.
5. The method according to claim 4, characterized in that The method further comprises: Obtaining the first color value and the base system corresponding to the first color value; Obtain the second color value and the base system corresponding to the second color value; The base system corresponding to the first color value or the base system corresponding to the second color value is uniformly converted.
6. A device for updating the view color of an application interface, characterized in that: include: A color value acquisition module, used to acquire view data of an application interface and a first color value corresponding to the view data, wherein the application includes a color function; The instruction acquisition module is used to acquire a color conversion instruction and insert a color value conversion function before a color function according to the color conversion instruction, including: calling an extraction function and a color value conversion function corresponding to the extraction function according to the color conversion instruction; acquiring the position of the color function, and inserting the color value conversion function before the color function using the extraction function; A color value conversion module, used for converting the first color value to obtain a second color value according to the color value conversion function, comprising: obtaining the first color value and a color value conversion formula corresponding to the color value conversion function; converting the first color value to a second color value according to the color value conversion formula, wherein the color value conversion formula includes a conversion factor, and multiplying the first color value by the conversion factor to obtain the second color value; A color updating module is used for updating the color of the view according to the second color value by the color function.
7. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 5 is implemented.
8. An electronic device, characterized in that: include: processor; as well as A memory for storing one or more programs, which, when executed by the one or more processors, enables the one or more processors to implement the method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Method and device for dyeing virtual object model, storage medium and electronic equipment
CN108198250A