# @masd.lab on Instagram

- **Type:** Video
- **Original URL:** https://www.instagram.com/p/DByg1Pjs60s
- **Gondola URL:** https://gondola.cc/posts/61256135-masdlab-instagram
- **Thumbnail:** https://img.gondola.cc/tr:w-,h-,fo-auto/postThumbnails/9ac41ab5e1.jpg
- **Posted:** 2024-10-31T12:55:20.000+00:00
- **Account Owner:** Marcos Silva (@masd.lab) — https://gondola.cc/masd.lab

## Caption

Expression n.2 Proximity Based Colour Change.

This expression dynamically changes a layer’s color based on its distance from a target layer. As the layer moves closer, the color shifts smoothly to a defined “near” color, and as it moves farther away, it transitions back to the default color. 

//apply on Fill or Colour properties

var targetLayer = thisComp.layer(“Shape Layer 1”);
var minDistance = 50;
var maxDistance = 200;
var nearColor = [0.9373, 0.0275, 0.2902, 1];
var defaultColor = [0.0667, 0.0667, 0.0667, 1];
var distance = length(thisLayer.position, targetLayer.position);
linear(distance, minDistance, maxDistance, nearColor, defaultColor);

#AfterEffects #AETips #MotionDesign #ExpressionMagic #DynamicColor #ColorTransition #ProximityEffect #DesignTutorial #MotionGraphics #AnimationTips #CreativeEffects #AEExpressions #ColorChange #VisualEffects #LayerInteraction

## Stats

- **Views:** 1,951
- **Likes:** 326
- **Shares:** 0
- **Comments:** 0

## Tags

aeexpressions, colortransition, aetips, designtutorial, motiondesign, layerinteraction, expressionmagic, dynamiccolor, creativeeffects, visualeffects, aftereffects, motiongraphics, animationtips, colorchange, proximityeffect

---
Copyright (c) Gondola