merge_colour

Merges two colours by a given amount.

Syntax:

GML Code Example

merge_colour(col1, col2, amount);


Argument Description
col1 The first colour to merge
col2 The second colour to merge
amount How much of each colour should be merged. For example, 0 will return col1, 1 will return col2, and 0.5 would return a merge of both colours equally


Returns: value


Description

With this function you can take two colours and then merge them together to make a new colour. The amount of each of the component colours can be defined by changing the "amount" argument, where a value of 0 will return the first colour (col1), a value of 1 will return the second colour (col2) and a value in between will return the corresponding mix. For example, a value of 0.5 will mix the two colours equally. The following image illustrates how this works by merging the colours red and blue together:


Example:

GML Code Example

col = merge_colour(c_lime, c_orange, 0.5);

The above code uses the function to create a colour by merging lime and orange 50/50 and then stores its value in the variable "col" for later use.





No Examples Submitted

Does this page need better examples? Be the first to Submit

No Edits Suggested

Is this page unclear or not descriptive enough? Suggest an edit to the page and with enough upvotes your changes will be made.

No Questions Have Been Ask

Do you have a question about this page? Ask it Here