setSubmobjectColorsByRadialGradient method
void
setSubmobjectColorsByRadialGradient({})
Implementation
void setSubmobjectColorsByRadialGradient(
{Vector3? center,
double? radius,
required Color innerColor,
required Color outerColor}) {
center ??= getCenter();
radius ??= 1;
for (var mob in getFamilyWithPoints()) {
var t = (mob.getCenter() - center).norm() / radius;
t = min(t, 1);
var color = interpolateValue(innerColor, outerColor, t);
mob.setColor(color: color, family: false);
}
}