Home/ Reference/ Color

color.BlendWith(OtherColor, Weight)

Mixes two colors into an in-between shade. Automatic palettes and tonal ramps. Weight is the mix ratio.

Signature

color.BlendWith(OtherColor, Weight)

Notes

Mixes two colors into an in-between shade. Automatic palettes and tonal ramps. Weight is the mix ratio.

Python example (runnable)

Requires pywin32. The example assumes app / doc / page / layer are already connected. See Connection & Init
Python
a = app.CreateRGBColor(0, 133, 205)                 # blue
b = app.CreateRGBColor(255, 255, 255)               # white

mix = a.GetCopy()                                   # copy it first so the original stays untouched
mix.BlendWith(b, 50)                                # mix 50% with white
print("Mixed colour: ", mix.HexValue)

About this section: Color

Color — RGB, CMYK and hex color values.

Other entries in this section