Color changing method, device and electronic equipment in game
Patent Information
- Application Number
- CN202310936125.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-27
- Publication Date
- 2026-10-30
- Estimated Expiration
- 2043-07-27
AI Technical Summary
[0002]在游戏编辑器中可以根据玩家需求更新组件的颜色,通常每个组件对应有至少一个染色区域,玩家每次可调节组件中的一个染色区域对应的颜色,如果玩家想要更新多个组件的颜色,该方式操作繁琐,导致玩家组件调色效率较低,影响玩家游戏体验
[0009]本公开提供的一种游戏中的换色方法、装置和电子设备,首先响应针对游戏编辑场景包含的多个场景组件的配色操作,从多个配色组合中确定目标配色组合,其中,配色组合中包括:第一预设数量个色块标识的排序序号,以及色块标识对应的颜色;然后响应针对目标配色组合的应用指令,对多个场景组件的染色区域配置的颜色进行聚类处理,得到第二预设数量个颜色聚类和颜色聚类对应的聚类排序,根据颜色聚类的聚类排序和色块标识的排序序号确定颜色聚类对应的色块标识,根据色块标识在目标配色组合中对应的颜色为颜色聚类中的颜色对应的染色区域配置颜色,并在图形用户界面中显示配置染色区域的颜色后的多个场景组件。该方式中,玩家可通过选中的配色组合对游戏编辑场景包含的多个场景组件进行整体换色,提高了组件的换色效率,从而提升了玩家游戏体验。
Smart Images

Figure CN116999815B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of game interaction design technology, and in particular to a color-changing method, device and electronic device in a game. Background Technology
[0002] In the game editor, the color of components can be updated according to the player's needs. Usually, each component has at least one coloring area. The player can adjust the color of one coloring area in the component at a time. If the player wants to update the color of multiple components, this method is cumbersome, resulting in low efficiency in adjusting the color of components and affecting the player's game experience. Summary of the Invention
[0003] This disclosure provides a color-changing method, device, and electronic device for games, enabling rapid color-changing of multiple scene components in a game editing scene, improving component color-changing efficiency, and thereby enhancing the player's gaming experience.
[0004] In a first aspect, this disclosure provides a color-changing method in a game. The method includes: displaying a graphical user interface by running a game program, the graphical user interface including a game editing scene to be edited, the game editing scene including multiple scene components, each scene component including at least one coloring region, the coloring region being used to configure colors for the scene component; responding to color matching operations for multiple scene components, determining a target color matching combination from multiple color matching combinations, wherein the color matching combination includes: a first preset number of sorting numbers of color block identifiers, and the colors corresponding to the color block identifiers; responding to an application instruction for the target color matching combination, performing clustering processing on the colors configured in the coloring regions of the multiple scene components to obtain a second preset number of color clusters and a clustering order corresponding to the color clusters, determining the color block identifiers corresponding to the color clusters according to the clustering order of the color clusters and the sorting numbers of the color block identifiers, configuring colors for the coloring regions corresponding to the colors in the color clusters according to the colors corresponding to the color block identifiers in the target color matching combination, and displaying the multiple scene components after configuring the colors of the coloring regions in the graphical user interface.
[0005] Secondly, this disclosure provides a color-changing device in a game, comprising: an interface display module for displaying a graphical user interface by running a game program, the graphical user interface including a game editing scene to be edited, the game editing scene including multiple scene components, each scene component including at least one coloring area, the coloring area being used to configure colors for the scene component; a color selection module for responding to color matching operations for multiple scene components, determining a target color matching combination from multiple color matching combinations, wherein the color matching combination includes: a first preset number of sorting numbers of color block identifiers, and the colors corresponding to the color block identifiers; and a component color-changing module for responding to application instructions for the target color matching combination, performing clustering processing on the colors configured in the coloring areas of multiple scene components to obtain a second preset number of color clusters and a clustering order corresponding to the color clusters, determining the color block identifiers corresponding to the color clusters according to the clustering order of the color clusters and the sorting numbers of the color block identifiers, configuring colors for the coloring areas corresponding to the colors in the color clusters according to the colors corresponding to the color block identifiers in the target color matching combination, and displaying multiple scene components after configuring the colors of the coloring areas in the graphical user interface.
[0006] Thirdly, this disclosure provides an electronic device including a processor and a memory, the memory storing machine-executable instructions that can be executed by the processor, the processor executing the machine-executable instructions to implement the color-changing method in the above-mentioned game.
[0007] Fourthly, this disclosure provides a computer-readable storage medium storing computer-executable instructions that, when invoked and executed by a processor, cause the processor to implement the color-changing method in the aforementioned game.
[0008] The embodiments disclosed herein bring the following beneficial effects:
[0009] This disclosure provides a color-changing method, device, and electronic device for games. First, in response to a color-matching operation for multiple scene components within a game editing scene, a target color-matching combination is determined from multiple color combinations. This color-matching combination includes: a first preset number of sorted color block identifiers and the colors corresponding to the color block identifiers. Then, in response to an application instruction for the target color-matching combination, the colors configured for the stained areas of the multiple scene components are clustered to obtain a second preset number of color clusters and their corresponding cluster sorting. The color block identifiers corresponding to the color clusters are determined based on the cluster sorting and the sorted number of the color block identifiers. The stained areas corresponding to the colors in the color clusters are configured with colors based on the colors corresponding to the color block identifiers in the target color-matching combination, and the multiple scene components with the configured stained areas are displayed in a graphical user interface. In this method, players can change the overall color of multiple scene components within a game editing scene using a selected color-matching combination, improving the efficiency of component color-changing and thus enhancing the player's gaming experience.
[0010] Other features and advantages of this disclosure will be set forth in the following description, or some features and advantages may be inferred from the description or determined without doubt, or may be learned by practicing the techniques described above.
[0011] To make the above-mentioned objects, features and advantages of this disclosure more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description
[0012] To more clearly illustrate the technical solutions in the specific embodiments of this disclosure or the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this disclosure. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0013] Figure 1 A flowchart of a color-changing method in a game provided by an embodiment of this disclosure;
[0014] Figure 2 A schematic diagram of a first editing window provided in an embodiment of this disclosure;
[0015] Figure 3 A schematic diagram of a color matching interface provided in an embodiment of this disclosure;
[0016] Figure 4 A schematic diagram illustrating the display of a color scheme list provided in an embodiment of this disclosure;
[0017] Figure 5A schematic diagram of a color palette editing interface provided in an embodiment of this disclosure;
[0018] Figure 6 A flowchart of another color-changing method in a game provided as an embodiment of this disclosure;
[0019] Figure 7 This is a schematic diagram illustrating the color changing of scene components in a game editing scene according to an embodiment of the present disclosure;
[0020] Figure 8 This is a schematic diagram of the structure of a color-changing device in a game provided by an embodiment of the present invention;
[0021] Figure 9 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention.
[0022] icon:
[0023] 1-First editing window; 2-Color selection control; 3-Color display area. Detailed Implementation
[0024] To make the objectives, technical solutions, and advantages of the embodiments of this disclosure clearer, the technical solutions of the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this disclosure, and not all embodiments. The components of the embodiments of this disclosure described and shown in the accompanying drawings can generally be arranged and designed in various different configurations.
[0025] Therefore, the following detailed description of the embodiments of this disclosure provided in the accompanying drawings is not intended to limit the scope of the claimed disclosure, but merely to illustrate selected embodiments of the disclosure. All other embodiments obtained by those skilled in the art based on the embodiments of this disclosure without inventive effort are within the scope of protection of this disclosure.
[0026] In one embodiment of this disclosure, the color-changing method in the game can run on a local terminal device or a server. When the color-changing method in the game runs on a server, the method can be implemented and executed based on a cloud interaction system, wherein the cloud interaction system includes a server and a client device.
[0027] In an optional implementation, various cloud applications, such as cloud gaming, can run under the cloud interaction system. Taking cloud gaming as an example, cloud gaming refers to a gaming method based on cloud computing. In the cloud gaming operating mode, the game program and the game screen presentation are separated. The storage and execution of color-changing methods in the game are completed on the cloud gaming server. The client device is used for data reception, transmission, and game screen presentation. For example, the client device can be a display device with data transmission capabilities located close to the user, such as a mobile terminal, television, computer, or PDA; however, the information processing is performed by the cloud gaming server in the cloud. When playing the game, the player operates the client device to send operation commands to the cloud gaming server. The cloud gaming server runs the game according to the operation commands, encodes and compresses the game screen and other data, returns it to the client device via the network, and finally, the client device decodes and outputs the game screen.
[0028] In an optional implementation, taking a game as an example, the local terminal device stores the game program and is used to display the game screen. The local terminal device is used to interact with the player through a graphical user interface (GUI), i.e., conventionally by downloading, installing, and running the game program via an electronic device. The local terminal device can provide the GUI to the player in various ways, such as rendering it on the terminal's display screen or providing it to the player via holographic projection. For example, the local terminal device can include a display screen for displaying the GUI, which includes game screens, and a processor for running the game, generating the GUI, and controlling the display of the GUI on the display screen.
[0029] In one possible implementation, embodiments of this disclosure provide a color-changing method in a game, such as... Figure 1 As shown, the method includes the following specific steps:
[0030] Step S102: A graphical user interface is displayed by running the game program. The graphical user interface includes a game editing scene to be edited. The game editing scene includes multiple scene components. Each scene component includes at least one tinted area, which is used to configure the color of the scene component.
[0031] In practical implementation, the aforementioned game editing scene is a scene provided by the running game program, which can also be understood as a scene provided by the game editor. Within the game editing scene, editable components can be edited, and the edited components are then designated as scene components and set within the game editing scene. In actual application, when a player triggers a game editing command, the game editing scene can be displayed in the graphical user interface. This game editing command can be determined according to the game rules. For example, the editing command could be an operation to enter the game editor; it could also be an operation to select a scene map for editing, etc.
[0032] In one specific embodiment, after displaying the game editing scene in the graphical user interface, scene components can be set in the game editing scene in the following manner: displaying a first editing window in the graphical user interface; wherein the first editing window includes multiple editable components; responding to an editing operation on a target editable component among the multiple editable components, controlling the generation of a scene component corresponding to the target editable component in the game editing scene.
[0033] Specifically, the component types and forms of the editable components included in the first editing window can be set according to R&D needs. For example... Figure 2 The image shown is a schematic diagram of a first editing window provided in an embodiment of the present invention. Figure 2 The rectangle corresponding to number 1 is the first editing window, which includes multiple types of editable components, including: terrain components, mechanism components, decoration components, and combination components. Each type of editable component also contains multiple editable components. Figure 2 The component categories for mechanisms also include motion mechanism components, functional mechanism components, logic components, object components, and floor components. Key motion mechanism components include cylinders, gears, cross gears, and clockwise turntables. The specific operations described above can be determined based on development needs or user settings. For example, an editing operation could be dragging the target editable component into the game editing scene, or clicking or long-pressing the target editable component in the first editing window.
[0034] In a specific implementation, the game editing scene contains multiple scene components, each including at least one tinted area used to configure the color of the scene component. In one specific embodiment, within a scene component, one tinted area corresponds to one color channel; the color channel stores the color parameters of the tinted area and updates the color of the tinted area according to the color parameters. Specifically, the tinted area updates its color using the currently stored color parameters in the color channel, thereby updating the color of the scene component corresponding to that tinted area. In an optional implementation, the tinted areas of the editable components corresponding to the scene components are pre-set during the component development stage; therefore, the number of tinted areas in the scene components included in the game editing scene, and the area corresponding to each tinted area within the scene component, are also pre-set. In another optional implementation, the tinted areas of the editable components corresponding to the scene components can be customized according to user settings, that is, different areas on the editing component can be set as different tinted areas through user interaction.
[0035] In an optional embodiment, to quickly change the color of scene components, the number of stained areas corresponding to the scene component may have an upper limit. The specific upper limit can be determined according to development needs or user settings. For example, the upper limit can be four. If a scene component contains four stained areas, then the scene component has four color channels. Each color channel can receive color parameters, which are mask textures containing the corresponding colors.
[0036] In another alternative embodiment, the scene component, including the stained area, can also be a fixed pattern, and the stained area cannot be customized. In this way, the color parameter field of the editor will be corresponding to the material of the scene component, so as to change the color of the scene component through the color parameter.
[0037] Step S104: In response to color matching operations for multiple scene components, determine the target color matching combination from multiple color matching combinations, wherein the color matching combination includes: the sorting number of a first preset number of color block identifiers, and the color corresponding to the color block identifier.
[0038] In practice, the specific operations for color matching described above can be determined based on development needs and player input, and are not specifically limited here. The color matching operations for multiple scene components refer to the operations of selecting color schemes for scene components within the game editing scene that can be recolored. These multiple color combinations are pre-set, including player-defined combinations and system-provided combinations. Each color combination includes: a first preset number of color block identifiers, and the corresponding color of each color block identifier. This can also be understood as each color combination containing a first preset number of colors. These color combinations are used to configure the colors of the colored areas of scene components within the game editing component. The specific number of these first preset numbers can be a system-preset number or a player-defined number; for example, the first preset number could be 10 or 12. The target color combination can be any one of the multiple color combinations, determined specifically by player input.
[0039] Within the first preset number of color blocks, different color blocks can be configured with different colors, and each color block is assigned a corresponding sorting number. This sorting number can be player-defined or system-preset. Furthermore, the sorting numbers for different color blocks are related to the importance of their corresponding colors; typically, the color block with the highest sorting number corresponds to the primary color, while the colors of subsequent sorting blocks correspond to secondary colors.
[0040] Step S106: In response to the application command for the target color scheme, cluster the colors configured in the stained areas of multiple scene components to obtain a second preset number of color clusters and the clustering order corresponding to the color clusters. Determine the color block identifier corresponding to the color cluster based on the clustering order of the color clusters and the sorting number of the color block identifier. Configure the stained area corresponding to the color in the color cluster based on the color of the color block identifier in the target color scheme, and display the multiple scene components after configuring the stained area color in the graphical user interface.
[0041] The application commands for the target color scheme can be determined based on game rules or player actions, and are not specifically limited here. When a player applies the target color scheme, the colors configured in the stained areas of multiple scene components within the game editing scene will be clustered, resulting in a second preset number of color clusters and their corresponding cluster rankings. This clustering process groups colors with similar configurations in the stained areas of scene components into the same category, and colors with significant color differences into different categories. The specific color clustering rules can be determined based on development needs.
[0042] The aforementioned second preset quantity can be the same as the first preset quantity, or it can be less than the first preset quantity. The specific values corresponding to the second and second preset quantities can be determined according to R&D needs. In a specific embodiment, both the first and second preset quantities can be 10. If the total number of colors in the stained areas of the scene components included in the game editing scene is less than the first preset quantity, then the colors of the stained areas can be clustered into a second preset quantity of color clusters. This second preset quantity is less than the first preset quantity, and the second preset quantity is less than or equal to the total number of colors in the stained areas of the scene components included in the game editing scene.
[0043] In practical applications, after clustering the colors configured for the stained areas of multiple scene components to obtain a second preset number of color clusters, it is necessary to sort these clusters according to a preset sorting rule to obtain a cluster sort for each color cluster. The sorting rules for different color clusters are different. These preset sorting rules can be determined based on development needs or player settings. For example, the preset sorting rule could be to sort the second preset number of color clusters according to the sum of the sizes of the stained areas corresponding to the colors in the cluster, from largest to smallest; or it could be to sort the second preset number of color clusters according to the number of color types in the cluster, etc.
[0044] After obtaining the clustering order corresponding to each color cluster, it is necessary to match the clustering order of the color cluster with the sorting number of the color block identifier. The color block identifier with the sorting number that matches a certain clustering order is configured as the color block identifier corresponding to the color cluster of that clustering order. Then, based on the color in the target color combination corresponding to the color block identifier of the color cluster, the color is configured for the stained area corresponding to the color in that color cluster.
[0045] For example, the target color scheme includes color 1 corresponding to the color block identifier with sorting number 1, color 2 corresponding to the color block identifier with sorting number 2, color 3 corresponding to the color block identifier with sorting number 3, and color 4 corresponding to the color block identifier with sorting number 4. The coloring region corresponding to the color in cluster 1 of the color with sorting number 1 is configured as color 1 corresponding to the color block identifier with sorting number 1; the coloring region corresponding to the color in cluster 2 of the color with sorting number 2 is configured as color 2 corresponding to the color block identifier with sorting number 2; the coloring region corresponding to the color in cluster 3 of the color with sorting number 3 is configured as color 3 corresponding to the color block identifier with sorting number 3; and the coloring region corresponding to the color in cluster 4 of the color with sorting number 4 is configured as color 4 corresponding to the color block identifier with sorting number 4.
[0046] This invention provides a color-changing method in a game, which allows players to change the overall color of multiple scene components in the game editing scene by selecting a color scheme, thereby improving the efficiency of component color changing and enhancing the player's gaming experience.
[0047] The following examples focus on describing how to determine the target color scheme.
[0048] Specifically, the process of determining the target color scheme from multiple color combinations in response to color matching operations on multiple scene components includes: displaying a color matching interface in a graphical user interface, which includes a color selection control, in response to a trigger operation on the color selection control; displaying a color list at a specified position on the color selection control, in response to a trigger operation on the color selection control, the color list displaying multiple color combinations, including: custom color combinations and / or preset color combinations in a preset color library; and selecting the target color combination in response to a selection operation on the target color combination in the color list.
[0049] In practical implementation, the color selection control included in the aforementioned color scheme interface can be displayed at any position within the interface, which can be determined according to development needs. The triggering operations for the color selection control include clicking, long-pressing, or swiping, etc., which can be specifically determined according to development needs. When a player triggers the color selection control, a color scheme list will be displayed at a designated position within the control. This list displays multiple color scheme combinations. The selection operation for a target color scheme combination can be clicking or long-pressing the target color scheme combination displayed in the color scheme list.
[0050] In an optional embodiment, the color matching interface further includes a hue display area, which includes a first preset number of color block identifiers, and different color block identifiers are configured with corresponding sorting numbers; the above method further includes: in response to a selection operation on a target color matching combination in the color matching list, configuring the first preset number of colors included in the target color matching combination as the colors corresponding to the first preset number of color block identifiers in the hue display area.
[0051] In its implementation, the color scheme display area uses color bars to identify corresponding colors, showcasing the colors included in a color combination. This helps players understand the colors included in their chosen color scheme, facilitating their selection. Each color block in the color scheme display area is assigned a corresponding sequence number, which can be user-defined or system-preset. Furthermore, different color blocks have different sequence numbers, which are related to their display position in the color scheme display area. For example, if four color blocks are displayed side-by-side in the color scheme display area, the first color block will have a sequence number of 1, the second will have 2, the third will have 3, and the fourth will have 4.
[0052] like Figure 3 The image shown is a schematic diagram of a color scheme interface provided in an embodiment of the present invention. The color scheme selection control is displayed at position 2 in this color scheme interface. Clicking the color scheme selection control will display... Figure 4 The color scheme list shown is a drop-down list of the color scheme selection control. This drop-down list displays the color scheme names of multiple color schemes (equivalent to the color combinations mentioned above). Figure 4 The color swatch name), and the specified number of colors whose sequence number is the first in the color block identifier in the color scheme (equivalent to...). Figure 4 The four color blocks displayed after the color palette name indicate the corresponding colors. This specified number can be determined based on development needs or player actions; for example, it can be four. Players can select a color scheme by clicking on it in the color scheme list.
[0053] Figure 3 The area corresponding to number 3 is the color tone display area, which contains 10 color block icons. The display position of the color block icons in the color tone display area matches their sorting sequence number. Specifically, the sorting sequence number of the 4 color block icons corresponding to the primary color increases from left to right, and the sorting sequence number of the 6 color block icons corresponding to the secondary color increases from left to right. Furthermore, the sorting sequence number of the color block icons under the primary color is less than the sorting sequence number of the color block icons under the secondary color. In one specific embodiment, the color scheme list displays a specified number of colors corresponding to the 4 color block icons under the primary color. Figure 3 The bottom right corner also includes an application control. Players can click on this application control to trigger an application command for the selected color scheme.
[0054] In practical applications, the multiple color schemes displayed in the above color scheme list may include only custom color schemes, only system-configured preset color schemes, or both. These preset color schemes are stored in a preset color scheme library, which contains one or more preset color schemes. Each preset color scheme includes: a first preset number of color block identifiers with a sorting sequence number, and a preset color configured for each color block identifier. Furthermore, the preset colors contained in different preset color schemes can be the same or different; that is, preset color schemes can contain the same preset color or different preset colors. When two preset color schemes contain the exact same preset color, the sorting sequence numbers of the color block identifiers configured for the preset color will differ in different preset color schemes.
[0055] In one specific embodiment, the above-mentioned custom color scheme combination is determined through the following steps 10-12:
[0056] Step 10: Display the color swatch editing interface in the graphical user interface; the color swatch editing interface includes an image upload control and a color tone display area.
[0057] In practical implementation, a player's specified trigger action can display a color palette editing interface in the graphical user interface. This specified trigger action can be determined based on development needs; for example, it could be clicking or long-pressing a control in the graphical user interface, or triggering an action on a specific area of the graphical user interface. For instance, the specified trigger action could be clicking... Figure 3 The interface displays the operation for creating a color swatch control. The color swatch editing interface shows an image upload control and a color tone display area. This display area includes a first preset number of color block identifiers. Different color block identifiers are configured with corresponding sorting numbers, and different color block identifiers can display different colors. Players can also generate custom color schemes by configuring the colors of the color block identifiers. These custom color schemes are used to configure the colors of the coloring areas of scene components in the game editing component.
[0058] like Figure 5 The image shown is a schematic diagram of a color palette editing interface provided in an embodiment of the present invention. Figure 5 In the mid-tone display area, the colors configured in each color block can be the same or different, depending on the player's actions. Figure 5 The "Reference Image" control mentioned above is the same as the image upload control mentioned above.
[0059] Step 11: In response to the input of a target image in the image upload control, extract colors from the target image to obtain a first preset number of colors, and configure the colors corresponding to the color block identifiers in the color display area according to the first preset number of colors.
[0060] Players can upload a target image using the image upload control. This target image can be any image entered by the player. In practice, clicking the upload control brings up an image resource manager containing multiple images or photos. The player can select any image as the target image and then click the "OK" button to complete the upload. After receiving the uploaded target image, the system extracts colors from it, retrieving a preset number of colors. These extracted colors are then configured as the colors corresponding to the color blocks in the hue display area. In some embodiments, after color extraction, the colors can also be displayed in the color block icons in the hue display area.
[0061] When the first preset quantity mentioned above is a player-defined quantity, the number of colors extracted from the target image can be based on the player-defined quantity, thus increasing the freedom of color extraction. In specific implementation, when extracting colors from the target image, the extracted colors can be any color contained in the target image, or colors that account for a large proportion of the target image.
[0062] Step 12: In response to the save operation, generate and save a custom color scheme combination; wherein, the custom color scheme combination includes: the sorting number of the first preset number of color block identifiers, and the target color corresponding to the color block identifier.
[0063] The specific steps of the save operation can be determined based on development needs or user actions. For example, the save operation could be clicking or long-pressing the save control in the graphical user interface, or triggering an operation on a specific area of the graphical user interface. After the player performs the save operation, a custom color scheme generated based on a first preset number of colors will be saved. This custom color scheme includes not only the sorting number of the first preset number of color block identifiers, but also the color corresponding to each color block identifier. For example, if the first preset number is 4, then the custom color scheme can include: color 1 corresponding to the color block identifier with sorting number 1, color 2 corresponding to the color block identifier with sorting number 2, color 3 corresponding to the color block identifier with sorting number 3, and color 4 corresponding to the color block identifier with sorting number 4.
[0064] In the above method, players can provide more replacement colors for scene components through multiple color combinations, thereby increasing the freedom of color replacement.
[0065] This disclosure also provides another color-changing method in a game, which is implemented based on the above embodiments. This method focuses on describing the filtering process of scene components when changing the colors of multiple scene components included in a game editing scene, and the color-changing process of the filtered scene components; such as... Figure 6 As shown, the method includes the following specific steps:
[0066] Step S602: A graphical user interface is displayed by running the game program. The graphical user interface includes a game editing scene to be edited. The game editing scene includes multiple scene components. Each scene component includes at least one coloring area, which is used to configure the color of the scene component.
[0067] Step S604: Respond to color matching operations for multiple scene components, determine the target color matching combination from multiple color matching combinations, the color matching combination includes: the sorting number of a first preset number of color block identifiers, and the color corresponding to the color block identifier.
[0068] The steps S602-S604 described above are the same as those in the above embodiments and will not be repeated here.
[0069] Step S606: In response to the application instruction for the target color scheme, filter multiple scene components to obtain the target scene component to be changed in color.
[0070] In practice, when a player triggers an application command for the target configuration combination, a component filtering mechanism is triggered. This means filtering out scene components that cannot be recolored, scene components configured to "not be displayed during gameplay", and scene components with trigger attributes in the game editing scene. The scene components retained in the filtered game editing scene are then identified as the target scene components.
[0071] In practical applications, if a player sets a block component to not display during gameplay, that block component becomes an invisible wall. If this block component is involved in subsequent color changes, and its size is large, it can easily result in poor or monotonous color changes in the game editing scene. Furthermore, for special components with trigger attributes, such as victory areas, event trigger areas, and switch areas, these components are often not visible during gameplay but can occupy a significant area, thus affecting the overall color change effect of the game editing scene.
[0072] Step S608: Cluster the colors configured in the stained areas of the target scene component to obtain a second preset number of color clusters and the cluster sorting corresponding to the color clusters. Determine the color block identifier corresponding to the color cluster based on the cluster sorting of the color clusters and the sorting number of the color block identifier. Configure the stained area color corresponding to the color in the color cluster based on the color corresponding to the color block identifier in the target color combination, and display the target scene component after configuring the stained area color in the graphical user interface.
[0073] This method is the same as the processing procedure in step S108 above, but this method enters the target scene component to perform one-click color change.
[0074] In the above method, the filtering mechanism for scene components included in the game editing scene can reduce some dirty data. That is, the scene components that are excluded by the filtering are not recolored, thereby improving the overall color-changing effect of scene components in the game editing scene.
[0075] The following examples focus on describing how to cluster the colors configured in the stained regions.
[0076] Specifically, the process of clustering the colors configured for the stained areas of multiple scene components to obtain a second preset number of color clusters and the corresponding cluster order can be achieved through the following steps 30-32:
[0077] Step 30: Obtain the colors configured for the stained areas of multiple scene components, as well as the dimensions of the stained areas.
[0078] In practice, when a player applies a target color scheme, the game scene information corresponding to the game editing scene is parsed to obtain the component size, the proportion of the stained area contained in each scene component, and the color of that area. Specifically, the size of a stained area can be obtained by using the component size of a scene component and the proportion of a certain stained area within it. The size of the aforementioned scene component can be the volume or surface area of the scene, etc.
[0079] In an optional embodiment, the colors configured for the stained areas in the aforementioned game editing scene can be RGB color values or LAB color values. LAB is a color space based on human visual perception, containing lightness (L) representing color brightness, and contrast and hue (A and B). A represents the color component from green to red, and B represents the color component from blue to yellow. The LAB space provides uniform perception; that is, if the LAB values change by the same magnitude, the visual changes are similar. In contrast, the RGB color space is merely a linear representation of the three color components (red (R), green (G), and blue (B), which cannot accurately reflect human color perception. Even with similar RGB value changes, the visual changes can vary significantly. Based on the above description, it is necessary to convert the RGB color values corresponding to the colors configured for the stained areas to the LAB space for clustering, i.e., clustering colors based on LAB color values.
[0080] Step 31: Cluster the colors configured in the stained areas of multiple scene components to obtain a second preset number of color clusters; wherein each color cluster includes at least one color.
[0081] In practical implementation, a second preset number of reference colors can be determined from the colors configured in the stained areas of multiple scene components according to preset clustering rules. These reference colors are then configured as cluster centers for color clusters. Based on the colors configured in the stained areas of multiple scene components and the cluster centers of the second preset number of color clusters, the colors configured in the stained areas of multiple scene components are clustered into their respective color clusters. Specifically, the aforementioned preset clustering rules can be determined based on the clustering algorithm used or according to player settings. For example, K-Means++ clustering or a Gaussian mixture model can be used for clustering. After obtaining the cluster centers of the second preset number of color clusters, the colors configured in the stained areas of scene components can be categorized into the color clusters corresponding to cluster centers with similar colors, thus obtaining the second preset number of color clusters.
[0082] In an optional embodiment, the specific process of determining a second preset number of reference colors from the colors configured in the stained areas of multiple scene components according to preset clustering rules, and configuring the reference colors as the cluster centers of color clustering, can be achieved through the following steps 40-45:
[0083] Step 40: Randomly determine a first reference color from the colors configured in the coloring regions of multiple scene components, and use the first reference color as the cluster center of the first color cluster.
[0084] The first reference color mentioned above is a color randomly determined from the colors configured in the shading areas of multiple scene components. In other words, the first reference color can be any one of the colors configured in the shading areas of multiple scene components.
[0085] Step 41: For each color in the color configuration of the stained area of multiple scene components, calculate the color difference between the color configured in the stained area and the first reference color.
[0086] Specifically, by subtracting the first reference color from the colors configured in the shading regions of multiple scene components, the color difference for each color can be obtained. This color difference is also the distance between the two colors. For example, the distance is the Euclidean distance in the LAB space, that is, the distance between two LAB colors (c11, c12, c13) and (c21, c22, c23) is equal to the square root of the sum of the squares of the differences between the three elements.
[0087] Step 42: Based on the color difference between the color configured in the stained area and the first reference color, determine the second reference color from the colors configured in the stained areas of multiple scene components, and use the second reference color as the cluster center of the second color cluster.
[0088] In specific implementation, the second reference color is different from the first reference color. The determination rule of the second reference color can be determined according to the clustering rule. For example, the second reference color can be the color with the largest color difference from the first reference color among the colors configured for the stained areas of multiple scene components, or it can be the color whose color difference from the first reference color among the colors configured for the stained areas of multiple scene components meets the preset condition, etc.
[0089] In one specific embodiment, the color difference between the color configured in the stained region and the first reference color can be used to determine the probability that the stained region's configured color will be selected as the second reference color. The color difference between the stained region's configured color and the first reference color is directly proportional to the probability that the stained region's configured color will be selected as the second reference color. Based on the probability that the stained region's configured color will be selected as the second reference color, the second reference color is determined from the stained region's configured colors of multiple scene components. In practical implementation, the larger the color difference between the stained region's configured color and the first reference color, the greater the probability that the stained region's configured color will be selected as the second reference color. That is, initially, when selecting a reference color, there is a tendency to choose a color that differs significantly from the currently existing reference colors from the stained region's configured colors as the reference color for another cluster.
[0090] Step 43: For each color in the color configuration of the stained region of multiple scene components, determine the minimum difference between the color configuration of the stained region and the cluster center.
[0091] When selecting the cluster center corresponding to the third color cluster, the color of each stained region in multiple scene components is first traversed, and the first difference between the color of each stained region and the first reference color, and the second difference between the color of each stained region and the second reference color are calculated. The smaller value between the first difference and the second difference is determined as the minimum difference between the color of the stained region and the cluster center.
[0092] Step 44: Add the minimum differences corresponding to the colors of the stained areas to obtain the sum.
[0093] Add the minimum difference between the colors of all the stained areas of the multiple scene components that need to be recolored, and get the sum.
[0094] Step 45: Based on the summation result and the colors configured in the stained areas of multiple scene components, determine the third reference color and use the third reference color as the cluster center of the third color cluster; continue to execute the step of determining the minimum difference between the stained area configuration color and the cluster center for each color in the stained area configuration of multiple scene components, until the cluster centers of the second preset number of color clusters are obtained.
[0095] In specific implementations, the third reference color differs from both the first and second reference colors. The determination rule for the third reference color can be based on clustering rules. In one specific embodiment, the color configured in the stained region can be divided by the summation result to obtain the division result; the probability of using the stained region's configured color as the third reference color is determined by the division result; wherein, the probability of the stained region's configured color as the third reference color is directly proportional to the division result; based on the probability of the stained region's configured color as the third reference color, the third reference color is determined from the stained region's configured colors of multiple scene components. That is, the third reference color is randomly determined from the stained region's configured colors of multiple scene components by considering the probability of the stained region's configured color as the third reference color.
[0096] After obtaining the third reference color, steps 43-45 will continue until the cluster centers of the second preset number of color clusters are obtained. However, after obtaining the third reference color, the cluster centers in step 43 include three, namely the first reference color, the second reference color, and the third reference color; the third reference color in step 45 then becomes the fourth reference color; after obtaining the fourth reference color, steps 43-45 will continue, but the cluster centers in step 43 include four, namely the first reference color, the second reference color, the third reference color, and the fourth reference color; the third reference color in step 45 then becomes the fifth reference color, and so on, until the second preset number of cluster centers are obtained.
[0097] Step 32: Sort the second preset number of color clusters according to the size of the stained regions corresponding to the colors contained in the color clusters to obtain the cluster sorting corresponding to the color clusters.
[0098] In practical implementation, the sizes of the stained regions corresponding to the colors included in each color cluster can be summed to obtain the sum of the sizes of the stained regions corresponding to each color cluster. Then, the second preset number of color clusters are sorted according to the descending order of the sums of the sizes of the stained regions corresponding to each color cluster to obtain the cluster sort. This allows colors that dominate the game editing scene to be replaced with the dominant hue of the target color scheme, which is also the first few colors in the sorting sequence of the color blocks.
[0099] In an optional embodiment, to prevent significant color differences in the stained areas of the same scene component when their colors are similar, the following steps 50-54 need to be performed before clustering the colors configured for the stained areas of multiple scene components to obtain a second preset number of color clusters:
[0100] Step 50: Obtain the first scene component containing multiple colored regions from multiple scene components.
[0101] Specifically, scene components containing a single tinted area will only be replaced with one color, eliminating the issue of significant color differences between scene components. The first scene component is the scene component within the game editing scene that contains at least two tinted areas.
[0102] Step 51: Identify the dominant coloring region in the first scene component whose proportion is greater than a preset proportion threshold, and determine the first scene component containing the dominant coloring region as the second scene component.
[0103] The aforementioned preset percentage threshold can be determined based on development needs or player settings. For example, the preset percentage threshold could be 55% or 60%. The aforementioned dominant coloring area refers to the coloring area contained in the first scene component, where the ratio (equivalent to percentage) between the size of the coloring area and the size of the first scene component is greater than the preset percentage threshold. The aforementioned second scene component is the scene component containing the dominant coloring area within the first scene component.
[0104] In an optional embodiment, for scene components that do not contain a dominant staining region in the first scene component, each staining region in each scene component is treated as a separate staining region and participates in subsequent clustering processing.
[0105] Step 52: If the color difference between the first stained region (excluding the dominant stained region) in the second scene component and the color of the dominant stained region in the second scene component is less than a preset color difference threshold, the multiple stained regions included in the second scene component are determined as a total stained region, and the color of the dominant stained region in the second scene component is determined as the color of the total stained region; wherein, the total stained region is used to participate in subsequent clustering processing.
[0106] The aforementioned total tinting region includes all tinting regions within the second scene component, and its size is the sum of the sizes of all tinting regions within the second scene component. In other words, when the colors of all tinting regions within the second scene component are similar to the color of the dominant tinting region, the second scene component is treated as a whole for subsequent clustering processing. This ensures that the colors of each tinting region within the second scene component remain similar after color changing, resulting in a more harmonious color scheme for the scene component.
[0107] For example, a grass component may include two colored regions: a larger colored region that is green and a smaller colored region that is light green. To prevent these two colored regions from being assigned to two different color clusters, they are bundled into a single total colored region, and the color of this total colored region is set to "green" to participate in subsequent clustering.
[0108] In practical implementation, it is also necessary to record the color difference between the first stained area and the dominant stained area in the total stained area; when configuring the color of the first stained area, the color of the first stained area is determined according to the color of the color block identifier corresponding to the color cluster to which the total stained area belongs in the target color combination, as well as the color difference between the first stained area and the dominant stained area.
[0109] Specifically, in order to ensure the color difference between different dyeing areas within the total dyeing area after color replacement, it is necessary to record the color difference between the first dyeing area and the dominant dyeing area within the total dyeing area. This allows us to determine the color to be updated for the total dyeing area based on the color block identifier corresponding to the color cluster to which the total dyeing area belongs in the target color matching component. Then, the color to be updated for the total dyeing area is determined as the color that the dominant dyeing area will replace. By adding the color to be updated for the total dyeing area to the color difference between the first dyeing area and the dominant dyeing area, we can obtain the color that the first dyeing area will replace.
[0110] Step 53: If, among the colors of other stained regions in the second scene component besides the dominant stained region, there exists a second stained region whose color difference from the color of the dominant stained region in the second scene component is less than a preset color difference threshold, the second stained region and the dominant stained region are jointly determined as the third stained region, and the color of the dominant stained region in the second scene component is determined as the color of the third stained region; wherein, the third stained region is used to participate in subsequent clustering processing; proceed to step 55.
[0111] When the color difference between the second stained area and the dominant stained area in the second scene component is less than a preset color difference threshold, the second stained area and the dominant stained area will be merged into a third stained area. The size of the third stained area is the sum of the sizes of the second stained area and the dominant stained area. That is, the second stained area in the second scene component with a color similar to the dominant stained area needs to be bound to the dominant stained area as a stained area to participate in the subsequent clustering process. This ensures that the stained areas with similar colors before the color change of the second scene component will still have similar colors after the color change, making the colors of the scene component look more harmonious.
[0112] In the specific implementation, it is also necessary to record the color difference between the second color area and the dominant color area in the third color area; when configuring the color of the second color area, the color of the second color area is determined according to the color block identifier of the color cluster to which the third color area belongs in the target color combination, as well as the color difference between the second color area and the dominant color area.
[0113] Specifically, in order to ensure the color difference between different dyeing areas within the third dyeing area after color replacement, it is necessary to record the color difference between the second dyeing area and the dominant dyeing area within the third dyeing area. Thus, based on the color block identifier corresponding to the color cluster to which the third dyeing area belongs and the corresponding color in the target color matching component, the color to be updated for the third dyeing area can be determined. Then, the color to be updated for the third dyeing area is determined as the color that the dominant dyeing area will replace. By adding the color to be updated for the third dyeing area to the color difference between the second dyeing area and the dominant dyeing area, the color that the second dyeing area will replace can be obtained.
[0114] Step 54: If, among the colors of other stained regions in the second scene component besides the dominant stained region, there is a fourth stained region whose color difference from the color of the dominant stained region in the second scene component is not less than a preset color difference threshold, then the fourth stained region is treated as a separate stained region and participates in subsequent clustering processing.
[0115] The above-described method of clustering colors configured in the stained area can group similar colors in the stained area configuration of scene components that need to be recolored into the same color cluster, thereby replacing the colors in the same color cluster with similar colors, making the game editing scene after color replacement more aesthetically pleasing.
[0116] The following examples focus on describing how to change the color of scene components based on the colors in the target color scheme.
[0117] In an optional embodiment, the specific process of configuring the color of the stained area corresponding to the color in the color cluster based on the color of the color block identifier in the target color combination can include: determining the color of the color block identifier corresponding to the color cluster in the target color combination as the target color in the color cluster, and configuring the stained area corresponding to the color in the color cluster as the target color. This method can quickly replace the color of the stained area in the game editing scene using the target color combination.
[0118] In another optional embodiment, since the number of colors replaced in the game editing scene in the above method is a second preset number, it is difficult to retain more and richer colors. Therefore, it is necessary to perform clustering processing on the colors configured in the stained areas of multiple scene components to obtain a second preset number of color clusters and the cluster ranking corresponding to the color clusters. Then, the center color corresponding to the color cluster and the color difference between the colors in the color cluster and the center color are determined. Then, based on the center color corresponding to the color cluster and the color difference between the colors in the color cluster and the center color, the stained areas are recolored using the target color scheme combination.
[0119] Specifically, the process of determining the center color of a color cluster can include: for each color in the color cluster, dividing the size of the stained region corresponding to the current color by the sum of the sizes of the stained regions corresponding to the colors in the color cluster to obtain the color weight; multiplying the color weight by the current color to obtain the multiplication result corresponding to the current color; and summing the multiplication results corresponding to the colors in the color cluster to determine the center color of the color cluster.
[0120] For example, a color cluster includes two colored regions, namely colored region 1 and colored region 2. The size of colored region 1 is s1 and the color is c1; the size of colored region 2 is s2 and the color is c2. Then the center color of this color cluster is s1 / s*c1+s2 / s*c2, where s is s1+s2.
[0121] Based on the above description, the specific process of configuring the color of the stained region corresponding to the color in the color cluster according to the color of the color block identifier in the target color combination may include: determining the color of the color block identifier corresponding to the color cluster in the target color combination as the color to be updated corresponding to the center color of the color cluster; determining the target color corresponding to the color in the color cluster according to the color to be updated corresponding to the center color of the color cluster and the color difference between the color in the color cluster and the center color; configuring the stained region corresponding to the color in the color cluster as the target color according to the target color.
[0122] In practical implementation, when calculating the center color within a class, the size of the stained area is considered, and the distance (i.e., color difference value) from the center color of each stained area is recorded. For example, a large dark red stained area and a small light red stained area will be grouped into the same color cluster. Taking the size of the stained area as a reference, the center color within the color cluster will lean towards dark red, thus maximizing the representation of the color cluster in the game editing scene. Simultaneously, the distances from the two stained areas to the center color are recorded. Therefore, when replacing with blue, the dark red stained area will become dark blue by adding the difference from the center color to the replacement color, and the light red stained area will become light blue. These two points maximize the representativeness of the center color and the diversity within the color cluster after color replacement.
[0123] In practical implementation, the process of determining the target color corresponding to a color in a color cluster can include: for each color in the color cluster, multiplying the color difference between the current color and the center color by a preset color weight to obtain a first result; and summing the first result with the color to be updated corresponding to the center color of the color cluster to determine the target color corresponding to the current color. The preset color weight can be determined according to development needs or player settings. For example, the preset color weight can be set to 0.3 or 0.4. Multiplying the color difference by the preset color weight ensures that the color difference of the target color corresponding to a color within the same color cluster is smaller, thus ensuring both the diversity and similarity of colors within the color cluster.
[0124] To facilitate understanding of the embodiments of the present invention, as follows: Figure 7 The diagram shown is a schematic of scene component color changing in a game editing scene according to an embodiment of the present invention. When the player applies the target color scheme, it will change the game scene information corresponding to the game editing scene (equivalent to...). Figure 7The map information is parsed to obtain the component size, the proportion of the colored area contained in the scene component, and the color of the scene component that needs to be recolored in the game editing scene. Then, the size of a colored area can be obtained by using the component size and the proportion of a certain colored area in the scene component. Then, the K-Means++ clustering algorithm is used to cluster the colors of the colored areas of the scene components that need to be recolored in the game editing scene, resulting in a second preset number of color clusters and the cluster ranking corresponding to each color cluster. Then, the center color of each color cluster and the color difference between the colors in the color cluster and the center color are calculated. Based on the received new color (equivalent to the target color scheme mentioned above), the colored areas of the scene components that need to be recolored in the game editing scene are recolored.
[0125] In an optional embodiment, the graphical user interface includes a first interactive control, which responds to a trigger operation on the first interactive control to control the generation of game scene information corresponding to the game editing scene; wherein, the game scene information includes component information of scene components in the game editing scene, and the scene component is an editing component that responds to the editing operation among multiple editable components in the editing window; and controls the transmission of the game scene information to the server; wherein, the server is configured to communicate with a first terminal device, the first terminal device is configured with a game program, and the first terminal device is configured to obtain game scene information from the server and generate a corresponding game scene through the game program based on the game scene information.
[0126] In practical applications, after triggering the first interactive control via a terminal device, game scene information corresponding to the game editing scene can be generated. This game scene information can be saved in a preset location, which can be a map file. This map file can save not only the game scene information but also other map information (including but not limited to screenshots, map names, logs, etc.). After the map file saves the game scene information, it is uploaded to the server. After the server approves it, it can publish the game scene generated from the game scene information to a preset map pool. Terminal devices connected to the server can then download the corresponding game scene information from the server and generate the corresponding game scene based on the game program, and then experience the game within that game scene. This method allows game scene information from the game editor to be published and experienced by other players, thus achieving rapid UGC (User Generated Content) functionality.
[0127] The above method reduces the time and complexity of coloring scene components for players when creating game scene information. Many ordinary players may not have a clear theme or have received comprehensive art color matching training when creating game scene information. Therefore, the color matching of the game scene information created by players may still have room for improvement. This technical solution aims to provide players with ideas, improve color matching, lower the operation threshold, and reduce the time cost for players by automating the process of color recognition and automatic color filling.
[0128] The following examples describe a method for changing the color of scene components in a selected scene area in a game editing scene with a single click.
[0129] Specifically, the graphical user interface mentioned above includes a region selection control; this region selection control is used to select a scene region in the game editing scene; the method of changing the color of scene components in the selected scene region in the game editing scene with one click includes the following steps 60-63:
[0130] Step 60: In response to a trigger operation on the region selection control, display the region selection indicator in the graphical user interface.
[0131] In practice, the aforementioned region selection marker can be an expandable or shrinkable rectangle or circle. Players can determine the target scene area by adjusting the range of the game editing scene defined by the region selection marker, that is, the scene range defined by the region selection marker is determined as the target scene area.
[0132] Step 61: Respond to the setting operation for the region selection identifier, and determine the target scene region selected by the region selection identifier in the game editing scene based on the setting operation.
[0133] Step 62: In response to color matching operations for scene components contained in the target scene area, determine the first color matching combination from multiple color matching combinations.
[0134] The first color scheme mentioned above can be any one of multiple color schemes. The method for determining the first color scheme can refer to the method for determining the target color scheme mentioned above, and will not be repeated here.
[0135] Step 63: In response to the application command for the first color scheme, cluster the colors configured for the stained areas of the scene components contained in the target scene area to obtain a third preset number of color clusters and the clustering order corresponding to the color clusters. Determine the color block identifier corresponding to the color cluster based on the clustering order of the color clusters and the sorting number of the color block identifier. Configure the stained area corresponding to the color in the color cluster based on the color of the color block identifier in the target color scheme, and display the scene components contained in the target scene area after configuring the stained area color in the graphical user interface.
[0136] The method of changing the colors of scene components within the target scene area using the first color scheme is the same as the method of changing the colors of multiple scene components using the target color scheme, and can be referred to the above color-changing method without further elaboration. This method can change the colors of local areas of the game editing scene, thereby increasing the freedom of changing the colors of scene components in the game editing scene.
[0137] In an optional embodiment, in response to a marking operation for a first scene component among a plurality of scene components, a marking feature of the first scene component is determined; in response to a color-changing operation for the first scene component, the color of the first scene component is updated to a color that matches the marking feature.
[0138] In practical implementation, the aforementioned first scene component can be any one of multiple scene components included in the game editing scene. The specific component chosen as the first scene component is determined by player actions. Players can mark the first scene component's features through a marking operation. These marking features indicate the characteristics of the scene component; for example, the marking feature could be a wall, road surface, or other features. When the first scene component is marked as a wall feature, changing its color will update it to the pre-set color corresponding to the wall feature. This method allows scene components with the same marking features to be set to the same color, which helps improve the visual effect of scene components in the game editing scene and also makes scene components with the same marking features have more consistent colors.
[0139] Corresponding to the above method embodiments, this invention also provides a color-changing device in a game, such as... Figure 8 As shown, the device includes:
[0140] The interface display module 80 is used to display a graphical user interface by running a game program. The graphical user interface includes a game editing scene to be edited. The game editing scene includes multiple scene components. Each scene component includes at least one coloring area, which is used to configure the color of the scene component.
[0141] The color selection module 81 is used to respond to color matching operations for multiple scene components and determine the target color matching combination from multiple color matching combinations. The color matching combination includes: the sorting number of a first preset number of color block identifiers and the color corresponding to the color block identifier.
[0142] The component color-changing module 82 is used to respond to application commands for a target color scheme combination, cluster the colors configured for the stained areas of multiple scene components, obtain a second preset number of color clusters and the clustering order corresponding to the color clusters, determine the color block identifier corresponding to the color cluster based on the clustering order of the color clusters and the sorting number of the color block identifier, configure the stained area corresponding to the color in the color cluster based on the color corresponding to the color of the color block identifier in the target color scheme combination, and display the multiple scene components after configuring the stained area color in the graphical user interface.
[0143] The color-changing device in the aforementioned game allows players to change the overall color of multiple scene components within the game's editing scene by selecting a color scheme, thus improving the efficiency of component color changing and enhancing the player's gaming experience.
[0144] Specifically, the above-mentioned device further includes a component editing module, used to: display a first editing window in a graphical user interface; wherein the first editing window includes multiple editable components; and respond to an editing operation on a target editable component among the multiple editable components, control the generation of a scene component corresponding to the target editable component in the game editing scene.
[0145] In the actual implementation, in the scene component, one stained area corresponds to one color channel; the color channel is used to store the color parameters of the stained area and configure the color of the stained area according to the color parameters.
[0146] Furthermore, the aforementioned device also includes a component filtering module, configured to: in response to an application instruction for a target color scheme, filter multiple scene components to obtain a target scene component to be color-changed; perform clustering processing on the colors configured in the stained areas of the multiple scene components, including: performing clustering processing on the colors configured in the stained areas of the target scene component; and display the multiple scene components with the colors configured in the stained areas in a graphical user interface, including: displaying the target scene component with the colors configured in the stained areas in the graphical user interface.
[0147] Furthermore, the aforementioned component color-changing module 82 includes: a size acquisition unit, used to acquire the colors configured in the stained areas of multiple scene components, and the size of the stained areas; a clustering unit, used to perform clustering processing on the colors configured in the stained areas of multiple scene components to obtain a second preset number of color clusters; wherein, each color cluster includes at least one color; and a sorting unit, used to sort the second preset number of color clusters according to the size of the stained areas corresponding to the colors included in the color clusters to obtain the cluster sorting corresponding to the color clusters.
[0148] In a specific implementation, the above-mentioned device further includes a region merging module, used for: before performing clustering processing on the colors configured in the stained regions of multiple scene components to obtain a second preset number of color clusters, obtaining a first scene component containing multiple stained regions in the multiple scene components; identifying the dominant stained region in the first scene component whose proportion is greater than a preset proportion threshold, and determining the first scene component containing the dominant stained region as a second scene component; if the color difference between the first stained region in the second scene component (excluding the dominant stained region) and the color of the dominant stained region in the second scene component is less than a preset color difference threshold, determining the multiple stained regions included in the second scene component as a total stained region, and determining the color of the dominant stained region in the second scene component as the color of the total stained region; wherein, the total stained region is used to participate in subsequent clustering processing.
[0149] Furthermore, the above-mentioned device also includes a color difference recording module, used to record the color difference between the first dyeing area and the dominant dyeing area in the total dyeing area; when configuring the color of the first dyeing area, the color of the first dyeing area is determined according to the color of the color block identifier corresponding to the color cluster to which the total dyeing area belongs in the target color matching combination, and the color difference between the first dyeing area and the dominant dyeing area.
[0150] Furthermore, the aforementioned region merging module is also used to: if, among the colors of other stained regions in the second scene component besides the dominant stained region, there exists a second stained region whose color difference with the color of the dominant stained region in the second scene component is less than a preset color difference threshold, then the second stained region and the dominant stained region are jointly determined as a third stained region, and the color of the dominant stained region in the second scene component is determined as the color of the third stained region; wherein, the third stained region is used to participate in subsequent clustering processing; if, among the colors of other stained regions in the second scene component besides the dominant stained region, there exists a fourth stained region whose color difference with the color of the dominant stained region in the second scene component is not less than a preset color difference threshold, then the fourth stained region is used as a separate stained region to participate in subsequent clustering processing.
[0151] Specifically, the aforementioned color difference recording module is also used to: record the color difference between the second color area and the dominant color area in the third color area; and when configuring the color of the second color area, determine the color of the second color area based on the color block identifier corresponding to the color cluster to which the third color area belongs in the target color combination, and the color difference between the second color area and the dominant color area.
[0152] Furthermore, the aforementioned clustering unit is used to: determine a second preset number of reference colors from the colors configured in the stained areas of multiple scene components according to preset clustering rules, and configure the reference colors as the cluster centers of the color clusters respectively; and cluster the colors configured in the stained areas of multiple scene components into the corresponding color clusters according to the colors configured in the stained areas of multiple scene components and the cluster centers of the second preset number of color clusters respectively.
[0153] In a specific implementation, the aforementioned clustering unit is further configured to: randomly determine a first reference color from the colors configured in the stained areas of multiple scene components, and use the first reference color as the cluster center of the first color cluster; calculate the color difference between the stained area configuration color and the first reference color for each color in the stained area configuration of multiple scene components; determine a second reference color from the stained area configuration colors of multiple scene components based on the color difference between the stained area configuration color and the first reference color, and use the second reference color as the cluster center of the second color cluster; determine the minimum difference between the stained area configuration color and the cluster center for each color in the stained area configuration of multiple scene components; sum the minimum differences corresponding to the colors of the stained areas to obtain a summed result; determine a third reference color based on the summed result and the stained area configuration colors of multiple scene components, and use the third reference color as the cluster center of the third color cluster; continue executing the step of determining the minimum difference between the stained area configuration color and the cluster center for each color in the stained area configuration of multiple scene components, until the cluster centers of the second preset number of color clusters are obtained.
[0154] Specifically, the clustering unit is further configured to: determine the probability that the color configured in the stained region is used as the second reference color by the color difference between the stained region and the first reference color; wherein the color difference between the stained region and the first reference color is proportional to the probability that the stained region is used as the second reference color; and determine the second reference color from the stained region configured colors of multiple scene components based on the probability that the stained region is used as the second reference color.
[0155] In practical applications, the above clustering unit is also used to: divide the color configured in the stained region by the summation result to obtain the division result; determine the probability of the stained region's configured color as the third reference color based on the division result; wherein the probability of the stained region's configured color as the third reference color is proportional to the division result; and determine the third reference color from the stained region's configured colors of multiple scene components based on the probability of the stained region's configured color as the third reference color.
[0156] Furthermore, the sorting unit is used to: sum the sizes of the stained regions corresponding to the colors contained in the color clusters to obtain the sum of the sizes of the stained regions corresponding to the color clusters; and sort the second preset number of color clusters in descending order of the sum of the sizes of the stained regions corresponding to the color clusters to obtain the cluster sorting corresponding to the color clusters.
[0157] Specifically, the above-mentioned device also includes a center color determination module, which is used to: after performing clustering processing on the colors configured in the stained areas of multiple scene components to obtain a second preset number of color clusters and the clustering order corresponding to the color clusters, determine the center color corresponding to the color cluster, and the color difference between the colors in the color cluster and the center color.
[0158] Furthermore, the aforementioned center color determination module is also used to: for each color in the color cluster, divide the size of the stained region corresponding to the current color by the sum of the sizes of the stained regions corresponding to the colors in the color cluster to obtain the color weight; multiply the color weight by the current color to obtain the multiplication result corresponding to the current color; and sum the multiplication results corresponding to the colors in the color cluster to determine the center color corresponding to the color cluster.
[0159] In an optional embodiment, the component color-changing module 82 is configured to: identify the color corresponding to the color block identifier of the color cluster in the target color combination as the color to be updated corresponding to the center color of the color cluster; determine the target color corresponding to the color in the color cluster based on the color to be updated corresponding to the center color of the color cluster and the color difference between the color in the color cluster and the center color; and configure the stained area corresponding to the color in the color cluster as the target color based on the target color.
[0160] Furthermore, the aforementioned component color-changing module 82 is also used to: for each color in the color cluster, multiply the color difference between the current color and the center color by a preset color weight to obtain a first result; and sum the first result with the color to be updated corresponding to the center color of the color cluster to determine the target color corresponding to the current color.
[0161] In an optional embodiment, the component color-changing module 82 is used to: identify the color block corresponding to the color cluster in the target color combination, determine it as the target color corresponding to the color in the color cluster, and configure the dyeing area corresponding to the color in the color cluster as the target color.
[0162] Furthermore, the aforementioned color selection module 81 is configured to: respond to color matching operations for multiple scene components, display a color matching interface in a graphical user interface, the color matching interface including a color selection control; respond to a trigger operation for the color selection control, display a color matching list at a specified position of the color selection control, the color matching list displaying multiple color matching combinations, the multiple color matching combinations including: custom color matching combinations and / or preset color matching combinations in a preset color matching library; and respond to a selection operation for a target color matching combination in the color matching list, selecting the target color matching combination.
[0163] Furthermore, the aforementioned color scheme interface also includes a hue display area, which includes a first preset number of color block identifiers, with each color block identifier configured with a corresponding sorting number; the aforementioned device also includes a hue display module, used to: in response to a selection operation on a target color scheme combination in the color scheme list, configure the first preset number of colors included in the target color scheme combination as the colors corresponding to the first preset number of color block identifiers in the hue display area.
[0164] In specific implementation, the above-mentioned custom color scheme combination is determined in the following way: a color swatch editing interface is displayed in the graphical user interface; wherein, the color swatch editing interface includes an image upload control and a hue display area; in response to the input of a target image in the image upload control, the target image is color extracted to obtain a first preset number of colors, and the colors corresponding to the color block identifiers in the hue display area are configured according to the first preset number of colors; in response to the save operation, the custom color scheme combination is generated and saved; wherein, the custom color scheme combination includes: the sorting number of the first preset number of color block identifiers, and the target color corresponding to the color block identifier.
[0165] Furthermore, the aforementioned graphical user interface includes a region selection control; the region selection control is used to select a scene region in the game editing scene; the aforementioned device also includes a local color-changing module, used to: respond to a trigger operation on the region selection control and display a region selection identifier in the graphical user interface; respond to a setting operation on the region selection identifier and determine the target scene region selected by the region selection identifier in the game editing scene based on the setting operation; respond to a color matching operation on the scene components contained in the target scene region and determine a first color matching combination from multiple color matching combinations; respond to an application instruction on the first color matching combination and perform clustering processing on the colors configured for the stained areas of the scene components contained in the target scene region to obtain a third preset number of color clusters and a clustering order corresponding to the color clusters; determine the color block identifier corresponding to the color cluster according to the clustering order of the color clusters and the sorting number of the color block identifier; configure the stained area color corresponding to the color in the color cluster according to the color corresponding to the color of the color block identifier in the target color matching combination; and display the scene components contained in the target scene region after configuring the stained area color in the graphical user interface.
[0166] Furthermore, the above-mentioned device also includes a feature marking module, used to: determine the marking features of the first scene component in response to a marking operation for the first scene component among a plurality of scene components; and update the color of the first scene component to a color that matches the marking features in response to a color-changing operation for the first scene component.
[0167] In a specific implementation, the graphical user interface includes a first interactive control, and the device further includes an information generation module, used to: respond to a trigger operation on the first interactive control and control the generation of game scene information corresponding to the game editing scene; wherein, the game scene information includes component information of scene components in the game editing scene, and the scene component is the editing component that responds to the editing operation among multiple editable components in the editing window; control the transmission of the game scene information to the server; wherein, the server is configured to communicate with a first terminal device, the first terminal device is configured with a game program, and the first terminal device is configured to obtain game scene information from the server and generate a corresponding game scene through the game program based on the game scene information.
[0168] The color-changing device in the game provided in this disclosure has the same implementation principle and technical effect as the aforementioned method embodiment. For the sake of brevity, any parts not mentioned in the device embodiment can be referred to the corresponding content in the aforementioned method embodiment.
[0169] This disclosure also provides an electronic device, such as... Figure 9 As shown, the electronic device includes a processor and a memory. The memory stores machine-executable instructions that can be executed by the processor, which executes the machine-executable instructions to implement the color-changing method in the game described above.
[0170] Specifically, the color-changing method in the aforementioned game includes: displaying a graphical user interface by running the game program, the graphical user interface including a game editing scene to be edited, the game editing scene including multiple scene components, each scene component including at least one coloring area, the coloring area being used to configure the color of the scene component; responding to color matching operations for multiple scene components, determining a target color matching combination from multiple color matching combinations, wherein the color matching combination includes: a first preset number of sorting numbers of color block identifiers, and the color corresponding to the color block identifier; responding to application instructions for the target color matching combination, performing clustering processing on the colors configured in the coloring areas of the multiple scene components to obtain a second preset number of color clusters and a clustering order corresponding to the color clusters, determining the color block identifier corresponding to the color cluster according to the clustering order of the color clusters and the sorting number of the color block identifiers, configuring the color of the coloring area corresponding to the color in the color cluster according to the color corresponding to the color of the color block identifier in the target color matching combination, and displaying the multiple scene components after configuring the color of the coloring area in the graphical user interface.
[0171] In the color-changing methods described above, players can change the overall color of multiple scene components in the game's editing scene by selecting a color scheme, which improves the efficiency of component color changing and thus enhances the player's gaming experience.
[0172] In an optional embodiment, the method further includes: displaying a first editing window in a graphical user interface; wherein the first editing window includes a plurality of editable components; and responding to an editing operation on a target editable component among the plurality of editable components, controlling the generation of a scene component corresponding to the target editable component in the game editing scene.
[0173] In an optional embodiment, in the scene component, one stained area corresponds to one color channel; the color channel is used to store the color parameters of the stained area and configure the color of the stained area according to the color parameters.
[0174] In an optional embodiment, the method further includes: responding to an application instruction for a target color combination, filtering multiple scene components to obtain a target scene component to be color-changed; performing clustering processing on the colors configured in the stained areas of the multiple scene components, including: performing clustering processing on the colors configured in the stained areas of the target scene component; and displaying the multiple scene components with the colors configured in the stained areas in a graphical user interface, including: displaying the target scene component with the colors configured in the stained areas in the graphical user interface.
[0175] In an optional embodiment, the step of clustering the colors configured in the stained areas of multiple scene components to obtain a second preset number of color clusters and a clustering order corresponding to the color clusters includes: obtaining the colors configured in the stained areas of multiple scene components and the size of the stained areas; clustering the colors configured in the stained areas of multiple scene components to obtain a second preset number of color clusters; wherein, each color cluster includes at least one color; and sorting the second preset number of color clusters according to the size of the stained area corresponding to the color included in the color cluster to obtain a clustering order corresponding to the color clusters.
[0176] In an optional embodiment, before clustering the colors configured in the stained regions of multiple scene components to obtain a second preset number of color clusters, the method further includes: obtaining a first scene component containing multiple stained regions; identifying a dominant stained region in the first scene component whose proportion is greater than a preset proportion threshold, and determining the first scene component containing the dominant stained region as a second scene component; if the color difference between the first stained region (excluding the dominant stained region) in the second scene component and the color of the dominant stained region in the second scene component is less than a preset color difference threshold, determining the multiple stained regions included in the second scene component as a total stained region, and determining the color of the dominant stained region in the second scene component as the color of the total stained region; wherein, the total stained region is used to participate in subsequent clustering processing.
[0177] In an optional embodiment, the method further includes: recording the color difference between the first stained region and the dominant stained region in the total stained region; when configuring the color of the first stained region, determining the color of the first stained region based on the color of the color block identifier corresponding to the color cluster to which the total stained region belongs in the target color combination, and the color difference between the first stained region and the dominant stained region.
[0178] In an optional embodiment, the method further includes: if, among the colors of other stained regions in the second scene component besides the dominant stained region, there exists a second stained region whose color difference with the color of the dominant stained region in the second scene component is less than a preset color difference threshold, the second stained region and the dominant stained region are jointly determined as a third stained region, and the color of the dominant stained region in the second scene component is determined as the color of the third stained region; wherein, the third stained region is used to participate in subsequent clustering processing; if, among the colors of other stained regions in the second scene component besides the dominant stained region, there exists a fourth stained region whose color difference with the color of the dominant stained region in the second scene component is not less than a preset color difference threshold, the fourth stained region is used as a separate stained region to participate in subsequent clustering processing.
[0179] In an optional embodiment, the method further includes: recording the color difference between the second stained region and the dominant stained region in the third stained region; when configuring the color of the second stained region, determining the color of the second stained region based on the color block identifier corresponding to the color cluster to which the third stained region belongs in the target color combination, and the color difference between the second stained region and the dominant stained region.
[0180] In an optional embodiment, the step of clustering the colors configured in the stained areas of multiple scene components to obtain a second preset number of color clusters includes: determining a second preset number of reference colors from the colors configured in the stained areas of multiple scene components according to preset clustering rules, and configuring the reference colors as the cluster centers of the color clusters respectively; and clustering the colors configured in the stained areas of multiple scene components into the corresponding color clusters according to the colors configured in the stained areas of multiple scene components and the cluster centers of the second preset number of color clusters respectively.
[0181] In an optional embodiment, the step of determining a second preset number of reference colors from the colors configured in the stained areas of multiple scene components according to preset clustering rules, and configuring the reference colors as the cluster centers of color clusters respectively, includes: randomly determining a first reference color from the colors configured in the stained areas of multiple scene components, and using the first reference color as the cluster center of a first color cluster; calculating the color difference between the stained area configured color and the first reference color for each color in the stained area configured colors of multiple scene components; and determining a second reference color from the colors configured in the stained areas of multiple scene components based on the color difference between the stained area configured color and the first reference color. For each color in the color configuration of the multiple scene components, the minimum difference between the configured color of the color in the color configuration of ... Configuration of the Color Configuration of the Color Configuration of the Color Configuration of the Color Configuration of the Color Configuration of the Color Configuration of the Color Configuration of the Color Configuration
[0182] In an optional embodiment, the step of determining the second reference color from the colors configured in the stained areas of multiple scene components based on the color difference between the stained area configuration color and the first reference color includes: determining the probability that the stained area configuration color is used as the second reference color based on the color difference between the stained area configuration color and the first reference color; wherein the color difference between the stained area configuration color and the first reference color is proportional to the probability that the stained area configuration color is used as the second reference color; and determining the second reference color from the colors configured in the stained areas of multiple scene components based on the probability that the stained area configuration color is used as the second reference color.
[0183] In an optional embodiment, the step of determining the third reference color based on the summation result and the colors configured in the stained areas of multiple scene components includes: dividing the colors configured in the stained areas by the summation result to obtain a division result; determining the probability of the stained area configuration color as the third reference color based on the division result; wherein the probability of the stained area configuration color as the third reference color is proportional to the division result; and determining the third reference color from the colors configured in the stained areas of multiple scene components based on the probability of the stained area configuration color as the third reference color.
[0184] In an optional embodiment, the step of sorting a second preset number of color clusters according to the size of the stained regions corresponding to the colors contained in the color clusters to obtain the cluster sorting corresponding to the color clusters includes: summing the sizes of the stained regions corresponding to the colors contained in the color clusters to obtain the sum of the sizes of the stained regions corresponding to the color clusters; and sorting the second preset number of color clusters in descending order of the sum of the sizes of the stained regions corresponding to the color clusters to obtain the cluster sorting corresponding to the color clusters.
[0185] In an optional embodiment, after performing clustering processing on the colors configured in the stained areas of multiple scene components to obtain a second preset number of color clusters and the cluster sorting corresponding to the color clusters, the above method further includes: determining the center color corresponding to the color cluster, and the color difference between the colors in the color cluster and the center color.
[0186] In an optional embodiment, the step of determining the center color corresponding to the color cluster includes: for each color in the color cluster, dividing the size of the stained region corresponding to the current color by the sum of the sizes of the stained regions corresponding to the colors in the color cluster to obtain the color weight; multiplying the color weight by the current color to obtain the multiplication result corresponding to the current color; and summing the multiplication results corresponding to the colors in the color cluster to determine the center color corresponding to the color cluster.
[0187] In an optional embodiment, the step of configuring the color of the stained region corresponding to the color in the color cluster based on the color corresponding to the color block identifier in the target color combination includes: determining the color corresponding to the color block identifier of the color cluster in the target color combination as the color to be updated corresponding to the center color of the color cluster; determining the target color corresponding to the color in the color cluster based on the color to be updated corresponding to the center color of the color cluster and the color difference between the color in the color cluster and the center color; and configuring the stained region corresponding to the color in the color cluster as the target color based on the target color.
[0188] In an optional embodiment, the step of determining the target color corresponding to a color in a color cluster based on the color to be updated corresponding to the center color of the color cluster and the color difference between the color in the color cluster and the center color includes: for each color in the color cluster, multiplying the color difference between the current color and the center color by a preset color weight to obtain a first result; and summing the first result with the color to be updated corresponding to the center color of the color cluster to determine the target color corresponding to the current color.
[0189] In an optional embodiment, the step of configuring the color of the stained region corresponding to the color in the color cluster according to the color of the color block identifier in the target color combination includes: determining the color of the color block identifier corresponding to the color cluster in the target color combination as the target color, and configuring the stained region corresponding to the color in the color cluster as the target color.
[0190] In an optional embodiment, the step of determining a target color scheme from multiple color scheme combinations in response to color matching operations on multiple scene components includes: displaying a color matching interface in a graphical user interface in response to color matching operations on multiple scene components, the color matching interface including a color matching selection control; displaying a color matching list at a specified position of the color matching selection control in response to a trigger operation on the color matching selection control, the color matching list displaying multiple color matching combinations, the multiple color matching combinations including: custom color matching combinations and / or preset color matching combinations in a preset color matching library; and selecting the target color matching combination in response to a selection operation on the target color matching combination in the color matching list.
[0191] In an optional embodiment, the color matching interface further includes a hue display area, which includes a first preset number of color block identifiers, and different color block identifiers are configured with corresponding sorting numbers; the method further includes: in response to a selection operation on a target color matching combination in the color matching list, configuring the first preset number of colors included in the target color matching combination as the colors corresponding to the first preset number of color block identifiers in the hue display area.
[0192] In an optional embodiment, the custom color scheme combination is determined as follows: a color swatch editing interface is displayed in a graphical user interface; wherein the color swatch editing interface includes an image upload control and a hue display area; in response to inputting a target image in the image upload control, colors are extracted from the target image to obtain a first preset number of colors, and the colors corresponding to the color block identifiers in the hue display area are configured according to the first preset number of colors; in response to a save operation, a custom color scheme combination is generated and saved; wherein the custom color scheme combination includes: the sorting number of the first preset number of color block identifiers, and the target color corresponding to the color block identifier.
[0193] In an optional embodiment, the graphical user interface includes a region selection control; the region selection control is used to select a scene region in the game editing scene; the method further includes: responding to a trigger operation on the region selection control, displaying a region selection identifier in the graphical user interface; responding to a setting operation on the region selection identifier, determining the target scene region selected by the region selection identifier in the game editing scene based on the setting operation; responding to a color matching operation on the scene components contained in the target scene region, determining a first color matching combination from multiple color matching combinations; responding to an application instruction on the first color matching combination, performing clustering processing on the colors configured for the stained areas of the scene components contained in the target scene region, obtaining a third preset number of color clusters and a clustering order corresponding to the color clusters, determining the color block identifier corresponding to the color cluster according to the clustering order of the color clusters and the sorting number of the color block identifier, configuring the stained area corresponding to the color in the color cluster according to the color of the color block identifier in the target color matching combination, and displaying the scene components contained in the target scene region after configuring the stained area color in the graphical user interface.
[0194] In an optional embodiment, the method further includes: in response to a marking operation on a first scene component among a plurality of scene components, determining a marking feature of the first scene component; and in response to a color-changing operation on the first scene component, updating the color of the first scene component to a color that matches the marking feature.
[0195] In an optional embodiment, the graphical user interface includes a first interactive control, and the method further includes: responding to a trigger operation on the first interactive control to control the generation of game scene information corresponding to the game editing scene; wherein the game scene information includes component information of scene components in the game editing scene, and the scene component is an editing component that responds to the editing operation among multiple editable components in the editing window; controlling the transmission of the game scene information to a server; wherein the server is configured to communicate with a first terminal device, the first terminal device is configured with a game program, and the first terminal device is configured to obtain game scene information from the server and generate a corresponding game scene through the game program based on the game scene information.
[0196] Furthermore, Figure 9 The electronic device shown also includes a bus 102 and a communication interface 103, with the processor 101, the communication interface 103 and the memory 100 connected via the bus 102.
[0197] The memory 100 may include high-speed random access memory (RAM) or non-volatile memory, such as at least one disk storage device. Communication between this system network element and at least one other network element is achieved through at least one communication interface 103 (which can be wired or wireless), such as the Internet, wide area network, local area network, or metropolitan area network. The bus 102 may be an ISA bus, PCI bus, or EISA bus, etc. The bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 9 The symbol is represented by a single double-headed arrow, but this does not mean that there is only one bus or one type of bus.
[0198] Processor 101 may be an integrated circuit chip with signal processing capabilities. In implementation, each step of the above method can be completed by the integrated logic circuitry in the hardware of processor 101 or by instructions in software form. The processor 101 can be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this disclosure. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this disclosure can be directly manifested as execution by a hardware decoding processor, or execution by a combination of hardware and software modules in the decoding processor. The software module can reside in a readily available storage medium in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or registers. This storage medium is located in memory 100, and processor 101 reads information from memory 100 and, in conjunction with its hardware, completes the steps of the method described in the foregoing embodiments.
[0199] This disclosure also provides a computer-readable storage medium storing computer-executable instructions. When these computer-executable instructions are called and executed by a processor, they cause the processor to implement the color-changing method in the game described above. For specific implementation details, please refer to the method embodiments, which will not be repeated here.
[0200] Specifically, the color-changing method in the aforementioned game includes: displaying a graphical user interface by running the game program, the graphical user interface including a game editing scene to be edited, the game editing scene including multiple scene components, each scene component including at least one coloring area, the coloring area being used to configure the color of the scene component; responding to color matching operations for multiple scene components, determining a target color matching combination from multiple color matching combinations, wherein the color matching combination includes: a first preset number of sorting numbers of color block identifiers, and the color corresponding to the color block identifier; responding to application instructions for the target color matching combination, performing clustering processing on the colors configured in the coloring areas of the multiple scene components to obtain a second preset number of color clusters and a clustering order corresponding to the color clusters, determining the color block identifier corresponding to the color cluster according to the clustering order of the color clusters and the sorting number of the color block identifiers, configuring the color of the coloring area corresponding to the color in the color cluster according to the color corresponding to the color of the color block identifier in the target color matching combination, and displaying the multiple scene components after configuring the color of the coloring area in the graphical user interface.
[0201] In the color-changing methods described above, players can change the overall color of multiple scene components in the game's editing scene by selecting a color scheme, which improves the efficiency of component color changing and thus enhances the player's gaming experience.
[0202] In an optional embodiment, the method further includes: displaying a first editing window in a graphical user interface; wherein the first editing window includes a plurality of editable components; and responding to an editing operation on a target editable component among the plurality of editable components, controlling the generation of a scene component corresponding to the target editable component in the game editing scene.
[0203] In an optional embodiment, in the scene component, one stained area corresponds to one color channel; the color channel is used to store the color parameters of the stained area and configure the color of the stained area according to the color parameters.
[0204] In an optional embodiment, the method further includes: responding to an application instruction for a target color combination, filtering multiple scene components to obtain a target scene component to be color-changed; performing clustering processing on the colors configured in the stained areas of the multiple scene components, including: performing clustering processing on the colors configured in the stained areas of the target scene component; and displaying the multiple scene components with the colors configured in the stained areas in a graphical user interface, including: displaying the target scene component with the colors configured in the stained areas in the graphical user interface.
[0205] In an optional embodiment, the step of clustering the colors configured in the stained areas of multiple scene components to obtain a second preset number of color clusters and a clustering order corresponding to the color clusters includes: obtaining the colors configured in the stained areas of multiple scene components and the size of the stained areas; clustering the colors configured in the stained areas of multiple scene components to obtain a second preset number of color clusters; wherein, each color cluster includes at least one color; and sorting the second preset number of color clusters according to the size of the stained area corresponding to the color included in the color cluster to obtain a clustering order corresponding to the color clusters.
[0206] In an optional embodiment, before clustering the colors configured in the stained regions of multiple scene components to obtain a second preset number of color clusters, the method further includes: obtaining a first scene component containing multiple stained regions; identifying a dominant stained region in the first scene component whose proportion is greater than a preset proportion threshold, and determining the first scene component containing the dominant stained region as a second scene component; if the color difference between the first stained region (excluding the dominant stained region) in the second scene component and the color of the dominant stained region in the second scene component is less than a preset color difference threshold, determining the multiple stained regions included in the second scene component as a total stained region, and determining the color of the dominant stained region in the second scene component as the color of the total stained region; wherein, the total stained region is used to participate in subsequent clustering processing.
[0207] In an optional embodiment, the method further includes: recording the color difference between the first stained region and the dominant stained region in the total stained region; when configuring the color of the first stained region, determining the color of the first stained region based on the color of the color block identifier corresponding to the color cluster to which the total stained region belongs in the target color combination, and the color difference between the first stained region and the dominant stained region.
[0208] In an optional embodiment, the method further includes: if, among the colors of other stained regions in the second scene component besides the dominant stained region, there exists a second stained region whose color difference with the color of the dominant stained region in the second scene component is less than a preset color difference threshold, the second stained region and the dominant stained region are jointly determined as a third stained region, and the color of the dominant stained region in the second scene component is determined as the color of the third stained region; wherein, the third stained region is used to participate in subsequent clustering processing; if, among the colors of other stained regions in the second scene component besides the dominant stained region, there exists a fourth stained region whose color difference with the color of the dominant stained region in the second scene component is not less than a preset color difference threshold, the fourth stained region is used as a separate stained region to participate in subsequent clustering processing.
[0209] In an optional embodiment, the method further includes: recording the color difference between the second stained region and the dominant stained region in the third stained region; when configuring the color of the second stained region, determining the color of the second stained region based on the color block identifier corresponding to the color cluster to which the third stained region belongs in the target color combination, and the color difference between the second stained region and the dominant stained region.
[0210] In an optional embodiment, the step of clustering the colors configured in the stained areas of multiple scene components to obtain a second preset number of color clusters includes: determining a second preset number of reference colors from the colors configured in the stained areas of multiple scene components according to preset clustering rules, and configuring the reference colors as the cluster centers of the color clusters respectively; and clustering the colors configured in the stained areas of multiple scene components into the corresponding color clusters according to the colors configured in the stained areas of multiple scene components and the cluster centers of the second preset number of color clusters respectively.
[0211] In an optional embodiment, the step of determining a second preset number of reference colors from the colors configured in the stained areas of multiple scene components according to preset clustering rules, and configuring the reference colors as the cluster centers of color clusters respectively, includes: randomly determining a first reference color from the colors configured in the stained areas of multiple scene components, and using the first reference color as the cluster center of a first color cluster; calculating the color difference between the stained area configured color and the first reference color for each color in the stained area configured colors of multiple scene components; and determining a second reference color from the colors configured in the stained areas of multiple scene components based on the color difference between the stained area configured color and the first reference color. For each color in the color configuration of the multiple scene components, the minimum difference between the configured color of the color in the color configuration of ... Configuration of the Color Configuration of the Color Configuration of the Color Configuration of the Color Configuration of the Color Configuration of the Color Configuration of the Color Configuration of the Color Configuration
[0212] In an optional embodiment, the step of determining the second reference color from the colors configured in the stained areas of multiple scene components based on the color difference between the stained area configuration color and the first reference color includes: determining the probability that the stained area configuration color is used as the second reference color based on the color difference between the stained area configuration color and the first reference color; wherein the color difference between the stained area configuration color and the first reference color is proportional to the probability that the stained area configuration color is used as the second reference color; and determining the second reference color from the colors configured in the stained areas of multiple scene components based on the probability that the stained area configuration color is used as the second reference color.
[0213] In an optional embodiment, the step of determining the third reference color based on the summation result and the colors configured in the stained areas of multiple scene components includes: dividing the colors configured in the stained areas by the summation result to obtain a division result; determining the probability of the stained area configuration color as the third reference color based on the division result; wherein the probability of the stained area configuration color as the third reference color is proportional to the division result; and determining the third reference color from the colors configured in the stained areas of multiple scene components based on the probability of the stained area configuration color as the third reference color.
[0214] In an optional embodiment, the step of sorting a second preset number of color clusters according to the size of the stained regions corresponding to the colors contained in the color clusters to obtain the cluster sorting corresponding to the color clusters includes: summing the sizes of the stained regions corresponding to the colors contained in the color clusters to obtain the sum of the sizes of the stained regions corresponding to the color clusters; and sorting the second preset number of color clusters in descending order of the sum of the sizes of the stained regions corresponding to the color clusters to obtain the cluster sorting corresponding to the color clusters.
[0215] In an optional embodiment, after performing clustering processing on the colors configured in the stained areas of multiple scene components to obtain a second preset number of color clusters and the cluster sorting corresponding to the color clusters, the above method further includes: determining the center color corresponding to the color cluster, and the color difference between the colors in the color cluster and the center color.
[0216] In an optional embodiment, the step of determining the center color corresponding to the color cluster includes: for each color in the color cluster, dividing the size of the stained region corresponding to the current color by the sum of the sizes of the stained regions corresponding to the colors in the color cluster to obtain the color weight; multiplying the color weight by the current color to obtain the multiplication result corresponding to the current color; and summing the multiplication results corresponding to the colors in the color cluster to determine the center color corresponding to the color cluster.
[0217] In an optional embodiment, the step of configuring the color of the stained region corresponding to the color in the color cluster based on the color corresponding to the color block identifier in the target color combination includes: determining the color corresponding to the color block identifier of the color cluster in the target color combination as the color to be updated corresponding to the center color of the color cluster; determining the target color corresponding to the color in the color cluster based on the color to be updated corresponding to the center color of the color cluster and the color difference between the color in the color cluster and the center color; and configuring the stained region corresponding to the color in the color cluster as the target color based on the target color.
[0218] In an optional embodiment, the step of determining the target color corresponding to a color in a color cluster based on the color to be updated corresponding to the center color of the color cluster and the color difference between the color in the color cluster and the center color includes: for each color in the color cluster, multiplying the color difference between the current color and the center color by a preset color weight to obtain a first result; and summing the first result with the color to be updated corresponding to the center color of the color cluster to determine the target color corresponding to the current color.
[0219] In an optional embodiment, the step of configuring the color of the stained region corresponding to the color in the color cluster according to the color of the color block identifier in the target color combination includes: determining the color of the color block identifier corresponding to the color cluster in the target color combination as the target color, and configuring the stained region corresponding to the color in the color cluster as the target color.
[0220] In an optional embodiment, the step of determining a target color scheme from multiple color scheme combinations in response to color matching operations on multiple scene components includes: displaying a color matching interface in a graphical user interface in response to color matching operations on multiple scene components, the color matching interface including a color matching selection control; displaying a color matching list at a specified position of the color matching selection control in response to a trigger operation on the color matching selection control, the color matching list displaying multiple color matching combinations, the multiple color matching combinations including: custom color matching combinations and / or preset color matching combinations in a preset color matching library; and selecting the target color matching combination in response to a selection operation on the target color matching combination in the color matching list.
[0221] In an optional embodiment, the color matching interface further includes a hue display area, which includes a first preset number of color block identifiers, and different color block identifiers are configured with corresponding sorting numbers; the method further includes: in response to a selection operation on a target color matching combination in the color matching list, configuring the first preset number of colors included in the target color matching combination as the colors corresponding to the first preset number of color block identifiers in the hue display area.
[0222] In an optional embodiment, the custom color scheme combination is determined as follows: a color swatch editing interface is displayed in a graphical user interface; wherein the color swatch editing interface includes an image upload control and a hue display area; in response to inputting a target image in the image upload control, colors are extracted from the target image to obtain a first preset number of colors, and the colors corresponding to the color block identifiers in the hue display area are configured according to the first preset number of colors; in response to a save operation, a custom color scheme combination is generated and saved; wherein the custom color scheme combination includes: the sorting number of the first preset number of color block identifiers, and the target color corresponding to the color block identifier.
[0223] In an optional embodiment, the graphical user interface includes a region selection control; the region selection control is used to select a scene region in the game editing scene; the method further includes: responding to a trigger operation on the region selection control, displaying a region selection identifier in the graphical user interface; responding to a setting operation on the region selection identifier, determining the target scene region selected by the region selection identifier in the game editing scene based on the setting operation; responding to a color matching operation on the scene components contained in the target scene region, determining a first color matching combination from multiple color matching combinations; responding to an application instruction on the first color matching combination, performing clustering processing on the colors configured for the stained areas of the scene components contained in the target scene region, obtaining a third preset number of color clusters and a clustering order corresponding to the color clusters, determining the color block identifier corresponding to the color cluster according to the clustering order of the color clusters and the sorting number of the color block identifier, configuring the stained area corresponding to the color in the color cluster according to the color of the color block identifier in the target color matching combination, and displaying the scene components contained in the target scene region after configuring the stained area color in the graphical user interface.
[0224] In an optional embodiment, the method further includes: in response to a marking operation on a first scene component among a plurality of scene components, determining a marking feature of the first scene component; and in response to a color-changing operation on the first scene component, updating the color of the first scene component to a color that matches the marking feature.
[0225] In an optional embodiment, the graphical user interface includes a first interactive control, and the method further includes: responding to a trigger operation on the first interactive control to control the generation of game scene information corresponding to the game editing scene; wherein the game scene information includes component information of scene components in the game editing scene, and the scene component is an editing component that responds to the editing operation among multiple editable components in the editing window; controlling the transmission of the game scene information to a server; wherein the server is configured to communicate with a first terminal device, the first terminal device is configured with a game program, and the first terminal device is configured to obtain game scene information from the server and generate a corresponding game scene through the game program based on the game scene information.
[0226] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this disclosure, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, a terminal device, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this disclosure. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0227] In the description of this disclosure, it should be noted that the terms "center," "upper," "lower," "left," "right," "vertical," "horizontal," "inner," and "outer," etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings, and are only for the convenience of describing this disclosure and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of this disclosure. Furthermore, the terms "first," "second," and "third" are used for descriptive purposes only and should not be construed as indicating or implying relative importance.
[0228] Finally, it should be noted that the above-described embodiments are merely specific implementations of this disclosure, used to illustrate the technical solutions of this disclosure, and not to limit it. The protection scope of this disclosure is not limited thereto. Although this disclosure has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments, or make equivalent substitutions for some of the technical features, within the scope of the technology disclosed in this disclosure. Such modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this disclosure, and should all be covered within the protection scope of this disclosure. Therefore, the protection scope of this disclosure should be determined by the protection scope of the claims.
Claims
1. A color-changing method in a game, characterized in that, The method includes: A graphical user interface is displayed by running the game program. The graphical user interface includes a game editing scene to be edited. The game editing scene includes multiple scene components. Each scene component includes at least one coloring area, which is used to configure the color of the scene component. In response to color matching operations for the multiple scene components, a target color matching combination is determined from multiple color matching combinations, wherein the color matching combination includes: a sorting number of a first preset number of color block identifiers, and the color corresponding to the color block identifier; In response to the application command for the target color scheme, the colors configured in the stained areas of the multiple scene components are clustered to obtain a second preset number of color clusters and a cluster sort corresponding to the color clusters. The color block identifier corresponding to the color cluster is determined according to the cluster sort and the sort number of the color block identifier. The stained area color corresponding to the color in the color cluster is configured according to the color of the color block identifier in the target color scheme, and the multiple scene components after configuring the stained area color are displayed in the graphical user interface. The step of clustering the colors configured in the stained areas of the multiple scene components to obtain a second preset number of color clusters and the cluster ranking corresponding to the color clusters includes: Obtain the colors configured for the stained areas of the multiple scene components, as well as the dimensions of the stained areas; The colors configured in the stained areas of the multiple scene components are clustered to obtain a second preset number of color clusters; wherein, each color cluster includes at least one color; Based on the size of the stained regions corresponding to the colors contained in the color clusters, the second preset number of color clusters are sorted to obtain the cluster sorting corresponding to the color clusters; Before the step of clustering the colors configured in the stained regions of the plurality of scene components to obtain the second preset number of color clusters, the method further includes: obtaining a first scene component containing multiple stained regions among the plurality of scene components; identifying a dominant stained region in the first scene component whose proportion is greater than a preset proportion threshold, and determining the first scene component containing the dominant stained region as a second scene component; if the color difference between the first stained region in the second scene component (excluding the dominant stained region) and the color of the dominant stained region in the second scene component is less than a preset color difference threshold, determining the plurality of stained regions included in the second scene component as a total stained region, and determining the color of the dominant stained region in the second scene component as the color of the total stained region; wherein, the total stained region is used to participate in subsequent clustering processing.
2. The method according to claim 1, characterized in that, The method further includes: A first editing window is displayed in the graphical user interface; wherein the first editing window includes multiple editable components; In response to an editing operation on a target editable component among the plurality of editable components, control the generation of a scene component corresponding to the target editable component in the game editing scene.
3. The method according to claim 1, characterized in that, In the scene component, one stained area corresponds to one color channel; the color channel is used to store the color parameters of the stained area and to configure the color of the stained area according to the color parameters.
4. The method according to claim 1, characterized in that, The method further includes: In response to the application command for the target color combination, the multiple scene components are filtered to obtain the target scene component to be changed in color; The step of clustering the colors configured in the stained areas of the multiple scene components includes: clustering the colors configured in the stained areas of the target scene component. The step of displaying the multiple scene components after configuring the color of the stained area in the graphical user interface includes: displaying the target scene component after configuring the color of the stained area in the graphical user interface.
5. The method according to claim 1, characterized in that, The method further includes: Record the color difference between the first stained region and the dominant stained region in the total stained region; when configuring the color of the first stained region, determine the color of the first stained region based on the color block identifier corresponding to the color cluster to which the total stained region belongs in the target color scheme, and the color difference between the first stained region and the dominant stained region.
6. The method according to claim 1, characterized in that, The method further includes: If, among the colors of other stained regions in the second scene component besides the dominant stained region, there exists a second stained region whose color difference from the color of the dominant stained region in the second scene component is less than a preset color difference threshold, then the second stained region and the dominant stained region are jointly determined as a third stained region, and the color of the dominant stained region in the second scene component is determined as the color of the third stained region; wherein, the third stained region is used to participate in subsequent clustering processing; If, among the colors of other stained regions in the second scene component besides the dominant stained region, there exists a fourth stained region whose color difference from the color of the dominant stained region in the second scene component is not less than a preset color difference threshold, then the fourth stained region will be treated as a separate stained region and participate in subsequent clustering processing.
7. The method according to claim 6, characterized in that, The method further includes: Record the color difference between the second stained region and the dominant stained region in the third stained region; when configuring the color of the second stained region, determine the color of the second stained region based on the color block identifier corresponding to the color cluster to which the third stained region belongs in the target color scheme, and the color difference between the second stained region and the dominant stained region.
8. The method according to claim 1, characterized in that, The step of clustering the colors configured in the stained areas of the multiple scene components to obtain the second preset number of color clusters includes: According to the preset clustering rules, a second preset number of reference colors are determined from the colors configured in the stained areas of the multiple scene components, and the reference colors are respectively configured as the cluster centers of the color clustering; Based on the colors configured in the stained areas of the multiple scene components and the cluster centers of the second preset number of color clusters, the colors configured in the stained areas of the multiple scene components are respectively clustered into the corresponding color clusters.
9. The method according to claim 8, characterized in that, The step of determining a second preset number of reference colors from the colors configured in the stained regions of the multiple scene components according to preset clustering rules, and configuring the reference colors as the cluster centers of the color clusters respectively, includes: From the colors configured in the stained areas of the multiple scene components, a first reference color is randomly determined, and the first reference color is used as the cluster center of the first color cluster. For each color configured in the stained area of the plurality of scene components, calculate the color difference between the configured color of the stained area and the first reference color; Based on the color difference between the color configured in the stained area and the first reference color, a second reference color is determined from the colors configured in the stained areas of the plurality of scene components, and the second reference color is used as the cluster center of the second color cluster. For each color configured in the stained regions of the multiple scene components, determine the minimum difference between the configured color of the stained region and the cluster center; The minimum differences corresponding to the colors of the dyed regions are added together to obtain the summation result; Based on the summation result and the colors configured in the stained areas of the multiple scene components, a third reference color is determined, and the third reference color is used as the cluster center of the third color cluster. The process continues to execute the step of determining the minimum difference between the stained area configuration color and the cluster center for each color in the stained area configuration of the multiple scene components, until the cluster centers of the second preset number of color clusters are obtained.
10. The method according to claim 9, characterized in that, The step of determining the second reference color from the colors configured in the stained areas of the plurality of scene components based on the color difference between the stained area and the first reference color includes: The color difference between the color configured in the dyed region and the first reference color is determined as the probability that the color configured in the dyed region is used as the second reference color; wherein, the color difference between the color configured in the dyed region and the first reference color is directly proportional to the probability that the color configured in the dyed region is used as the second reference color. The second reference color is determined from the colors configured in the stained areas of the plurality of scene components based on the probability that the color configured in the stained area is used as the second reference color.
11. The method according to claim 9, characterized in that, The step of determining the third reference color based on the summation result and the colors configured for the stained areas of the multiple scene components includes: Divide the color configured in the stained area by the summation result to obtain the division result; The probability of using the color configured in the stained region as the third reference color is determined by the division result; wherein the probability of using the color configured in the stained region as the third reference color is directly proportional to the division result. The third reference color is determined from the colors configured in the stained areas of the plurality of scene components based on the probability that the color configured in the stained area is used as the third reference color.
12. The method according to claim 1, characterized in that, The step of sorting the second preset number of color clusters according to the size of the stained regions corresponding to the colors included in the color clusters to obtain the cluster sorting corresponding to the color clusters includes: The sizes of the stained regions corresponding to the colors included in the color cluster are summed to obtain the sum of the sizes of the stained regions corresponding to the color cluster; The second preset number of color clusters are sorted according to the size of the stained regions corresponding to the color clusters and in descending order to obtain the cluster sorting corresponding to the color clusters.
13. The method according to claim 1, characterized in that, After the step of clustering the colors configured in the stained areas of the multiple scene components to obtain a second preset number of color clusters and the cluster ranking corresponding to the color clusters, the method further includes: Determine the center color corresponding to the color cluster, and the color difference between the colors in the color cluster and the center color.
14. The method according to claim 13, characterized in that, The step of determining the center color corresponding to the color cluster includes: For each color in the color cluster, divide the size of the stained region corresponding to the current color by the sum of the sizes of the stained regions corresponding to the colors in the color cluster to obtain the color weight; multiply the color weight by the current color to obtain the multiplication result corresponding to the current color; The sum of the multiplication results of the colors in the color cluster is used to determine the center color of the color cluster.
15. The method according to claim 13, characterized in that, The step of configuring the color of the stained region corresponding to the color in the color cluster according to the color of the color block identifier in the target color combination includes: The color block corresponding to the color cluster is identified as the color in the target color scheme and determined as the color to be updated corresponding to the center color of the color cluster. Based on the color to be updated corresponding to the center color of the color cluster, and the color difference between the colors in the color cluster and the center color, the target color corresponding to the color in the color cluster is determined; Based on the target color corresponding to the color in the color cluster, the stained region corresponding to the color in the color cluster is configured as the target color.
16. The method according to claim 15, characterized in that, The step of determining the target color corresponding to a color in a color cluster based on the color to be updated corresponding to the center color of the color cluster and the color difference between the colors in the color cluster and the center color includes: For each color in the color cluster, the color difference between the current color and the center color is multiplied by a preset color weight to obtain a first result; the sum of the first result and the color to be updated corresponding to the center color of the color cluster is determined as the target color corresponding to the current color.
17. The method according to claim 1, characterized in that, The step of configuring the color of the stained region corresponding to the color in the color cluster according to the color of the color block identifier in the target color combination includes: The color patch corresponding to the color cluster is identified as the target color in the target color scheme and determined as the target color in the color cluster. The stained area corresponding to the color in the color cluster is configured as the target color.
18. The method according to claim 1, characterized in that, The step of determining the target color scheme from multiple color scheme combinations in response to the color scheme operations of the multiple scene components includes: In response to color matching operations for the multiple scene components, a color matching interface is displayed in the graphical user interface, the color matching interface including a color selection control; In response to a trigger operation on the color selection control, a color list is displayed at a specified position on the color selection control. The color list displays multiple color combinations, including: custom color combinations and / or preset color combinations from a preset color library. In response to a selection operation on a target color scheme combination in the color scheme list, the target color scheme combination is selected.
19. The method according to claim 18, characterized in that, The color matching interface also includes a color display area, which includes the first preset number of color block identifiers, and each color block identifier is configured with a corresponding sorting number. The method further includes: In response to a selection operation on a target color combination in the color scheme list, the first preset number of colors included in the target color combination are configured as the colors corresponding to the first preset number of color block identifiers in the color display area.
20. The method according to claim 18, characterized in that, The custom color scheme combination is determined in the following way: The color swatch editing interface is displayed in the graphical user interface; wherein the color swatch editing interface includes an image upload control and a color tone display area; In response to the input of a target image in the image upload control, the target image is subjected to color extraction to obtain a first preset number of colors, and the color corresponding to the color block identifier in the color tone display area is configured according to the first preset number of colors; In response to the save operation, a custom color scheme combination is generated and saved; wherein, the custom color scheme combination includes: the sorting number of the first preset number of color block identifiers, and the target color corresponding to the color block identifier.
21. The method according to claim 1, characterized in that, The graphical user interface includes a region selection control; the region selection control is used to select a scene region in the game editing scene; the method further includes: In response to a trigger operation on the region selection control, a region selection indicator is displayed in the graphical user interface; In response to a setting operation for the region selection identifier, the target scene region selected by the region selection identifier in the game editing scene is determined based on the setting operation; In response to a color matching operation for scene components contained in the target scene area, a first color matching combination is determined from multiple color matching combinations; In response to the application command for the first color scheme, the colors configured in the stained areas of the scene components contained in the target scene area are clustered to obtain a third preset number of color clusters and a clustering order corresponding to the color clusters. The color block identifier corresponding to the color cluster is determined according to the clustering order of the color clusters and the sorting number of the color block identifier. The stained area corresponding to the color in the color cluster is configured with the color according to the color of the color block identifier in the target color scheme, and the scene components contained in the target scene area after configuring the stained area color are displayed in the graphical user interface.
22. The method according to claim 1, characterized in that, The method further includes: In response to a marking operation on a first scene component among the plurality of scene components, the marking features of the first scene component are determined; In response to a color-changing operation on the first scene component, the color of the first scene component is updated to a color that matches the marker feature.
23. The method according to claim 2, characterized in that, The graphical user interface includes a first interactive control, and the method further includes: In response to a trigger operation on the first interactive control, control the generation of game scene information corresponding to the game editing scene; wherein, the game scene information includes component information of scene components in the game editing scene, and the scene component is the editing component that responds to the editing operation among multiple editable components in the editing window; The control transmits the game scene information to the server; wherein the server is configured to communicate with a first terminal device, the first terminal device is configured with the game program, and the first terminal device is configured to obtain the game scene information from the server and generate a corresponding game scene based on the game scene information through the game program.
24. A color-changing device in a game, characterized in that, The device includes: The interface display module is used to display a graphical user interface by running a game program. The graphical user interface includes a game editing scene to be edited. The game editing scene includes multiple scene components. Each scene component includes at least one coloring area, which is used to configure the color of the scene component. The color selection module is used to respond to color matching operations for the multiple scene components, and to determine a target color matching combination from multiple color matching combinations, wherein the color matching combination includes: a sorting number of a first preset number of color block identifiers, and the color corresponding to the color block identifier; The component color-changing module is used to respond to application instructions for the target color scheme combination, perform clustering processing on the colors configured in the stained areas of the multiple scene components to obtain a second preset number of color clusters and the clustering order corresponding to the color clusters, determine the color block identifier corresponding to the color cluster according to the clustering order of the color clusters and the sorting number of the color block identifier, configure the stained area corresponding to the color in the color cluster according to the color corresponding to the color block identifier in the target color scheme combination, and display the multiple scene components after configuring the stained area color in the graphical user interface; The component color-changing module is further configured to: obtain the colors configured for the stained areas of the plurality of scene components, and the size of the stained areas; perform clustering processing on the colors configured for the stained areas of the plurality of scene components to obtain a second preset number of color clusters; wherein, the color clusters include at least one color; and sort the second preset number of color clusters according to the size of the stained areas corresponding to the colors included in the color clusters to obtain the cluster sorting corresponding to the color clusters. The region merging module is configured to: before performing clustering processing on the colors configured in the stained regions of the multiple scene components to obtain the second preset number of color clusters, obtain a first scene component containing multiple stained regions in the multiple scene components; identify the dominant stained region in the first scene component whose proportion is greater than a preset proportion threshold, and determine the first scene component containing the dominant stained region as a second scene component; if the color difference between the first stained region in the second scene component (excluding the dominant stained region) and the color of the dominant stained region in the second scene component is less than a preset color difference threshold, determine the multiple stained regions included in the second scene component as a total stained region, and determine the color of the dominant stained region in the second scene component as the color of the total stained region; wherein, the total stained region is used to participate in subsequent clustering processing.
25. An electronic device, characterized in that, The electronic device includes a processor and a memory, the memory storing machine-executable instructions that can be executed by the processor, the processor executing the machine-executable instructions to implement the color-changing method in the game according to any one of claims 1 to 23.
26. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when invoked and executed by a processor, cause the processor to implement the color-changing method in the game as described in any one of claims 1 to 23.
Citation Information
Patent Citations
Machine learning-based universal OCR training data generation system and method
CN112418224A
Method and Apparatus for Extracting Color Scheme from Video
US20210248379A1