Skip to main content

Home > blockly > utils > colour > blend

utils.colour.blend() function

Blend two colours together, using the specified factor to indicate the weight given to the first colour.

Signature:

export declare function blend(colour1: string, colour2: string, factor: number): string | null;

Parameters

ParameterTypeDescription
colour1stringFirst colour.
colour2stringSecond colour.
factornumberThe weight to be given to colour1 over colour2. Values should be in the range [0, 1].

Returns:

string | null

Combined colour represented in hex.