# @masd.lab on Instagram

- **Type:** Image
- **Original URL:** https://www.instagram.com/p/DCB2I5JMb6B
- **Gondola URL:** https://gondola.cc/posts/61255969-masdlab-instagram
- **Thumbnail:** https://img.gondola.cc/tr:w-,h-,fo-auto/postThumbnails/f4d7bab54a.jpg
- **Posted:** 2024-11-06T11:49:48.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);

Find more:
Links in Bio

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

## Stats

- **Views:** 0
- **Likes:** 596
- **Shares:** 0
- **Comments:** 4

## Tags

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

---
Copyright (c) Gondola