Skip to content

merge_color

Vašek edited this page Feb 10, 2019 · 2 revisions

merge_color

Returns merged color from the two given colors

Syntax:

merge_color(col1, col2, amount)
Argument Description
Color col1 The first color
Color col2 The other color
double amount Color merge ratio (from 0 to 1)

Returns: Color

Description:

This function merges two given colors into one. Set amount to 0.5 for the 1:1 ratio. If you set amount to 0, this function returns col1 and if you set amount to 1, this function returns col2.

Example:

Color col = merge_color(Color.Red, Color.Blue, 0.5);

This function will set col to 127 0 127 255, which is a violet.

Back to Color And Alpha

Clone this wiki locally