Skip to main content
Participating Frequently
May 8, 2022
Question

How do I quickly get the average between 2 colors and sample opacity with the eyedropper?

  • May 8, 2022
  • 2 replies
  • 1265 views

When changing the colors of pixels and using the paint tool I often need to blend 2 colors together. Like for example if one pixel is red and the other is blue is there a way for the eyedropper to take the value from both pixels and get the average color between the 2 as in purple? Or if there is a light blue pixel and dark blue pixel, using the eyedropper on both pixels to get a medium blue.

I'm sure this feature existed in some other app and thought it existed in AE but don't know how to access it.

 

Also, the eyedropper doesn't change the opacity setting of the paint tool when sampling colors. Is there a way to make it pick up the opacity value as well?

This topic has been closed for replies.

2 replies

ShiveringCactus
Community Expert
Community Expert
May 8, 2022

This intrigued me, so I've had a quick play at an expression.

 

var col1 = content("Rectangle 1").content("Fill 1").color;
var col2 = content("Polystar 1").content("Fill 1").color

var halfwayCol = [];
halfwayCol[0] = (col1[0]+col2[0])/2;
halfwayCol[1] = (col1[1]+col2[1])/2;
halfwayCol[2] = (col1[2]+col2[2])/2;
halfwayCol[3] = 1;
halfwayCol;

 

 

If you create a solid/null, and add three Expression Color Controls, you could add this expression to the third one, then save them all as an effect's preset.

Participating Frequently
May 10, 2022

I'm still new to AE so I don't know how to do this. Can you send me a project file or the effect preset?

ShiveringCactus
Community Expert
Community Expert
May 10, 2022

It's really quite a simple preset.  To add an expression to a value, hold down the ALT key and click on the stopwatch.  After pasting the below code, all that's left is to link the col1 and col2 values to the other colour pickers, so that it ends up like this:

 

var col1 = effect("Colour 1")("Color")
var col2 = effect("Colour 2")("Color")

var halfwayCol = [];
halfwayCol[0] = (col1[0]+col2[0])/2;
halfwayCol[1] = (col1[1]+col2[1])/2;
halfwayCol[2] = (col1[2]+col2[2])/2;
halfwayCol[3] = 1;
halfwayCol;

 

 

Here's the preset, but when you add it in, take a look at set up.

Preset saved on Dropbox 

 

Community Expert
May 8, 2022

The eyedropper only samples RGB values. You can use and expression to sample RGBA. I know of no Adobe app that lets you mix samples but there is a workaround. Create a new shape layer with a gradient fill. Sample red at one end of the gradient, then sample blue at the other end. The workflow looks something like this:

It's kind of funky, but it should do what you want to do.

Participating Frequently
May 10, 2022

This does what I want but it takes way too long to do when I need a new color every few seconds.

 

It would be way more convenient if a feature was added for sampling a secondary color with ctrl-alt-shift or something. I remember seeing a video of an artist using two color sampling to create perfect gradients between different points extremely fast by constantly mixing colors. I can see a lot of use cases for it when editing footage or images.