• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

How can I access the advanced color effects through actionscript

New Here ,
May 06, 2021 May 06, 2021

Copy link to clipboard

Copied

Hello I am trying to modify the color effect of a movieclip my problem is the only way animate does this from what I can see is through the advanced settings of color effects in the editor 

Image here.

color effects.png

Is there any way to access these features in as3.

Essentially I just want to make a color picker that can modify the movieclip's advanced color effects.

If anyone has an example of that, it would be very helpful.

Views

723

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , May 06, 2021 May 06, 2021

Then you did it wrong. That API is how you tint things.

Votes

Translate

Translate
LEGEND ,
May 06, 2021 May 06, 2021

Copy link to clipboard

Copied

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 06, 2021 May 06, 2021

Copy link to clipboard

Copied

I tried this but it turns the whole clip a solid color. Whereas the advanced color settings just change the hue of the movieclip.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 06, 2021 May 06, 2021

Copy link to clipboard

Copied

Then you did it wrong. That API is how you tint things.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 06, 2021 May 06, 2021

Copy link to clipboard

Copied

I ended up making an overlay clip to cast the color on the object. I couldnt figure out how to do it otherwise.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 06, 2021 May 06, 2021

Copy link to clipboard

Copied

 

// clip to tint, color (0 - 0xFFFFFF), saturation (0 - 1)
function tintClip(clip, color, sat) {
	var ct:ColorTransform = clip.transform.colorTransform;
	var r:int = color >> 16;
	var g:int = color >> 8 & 0xFF;
	var b:int = color & 0xFF;
	clip.transform.colorTransform = new ColorTransform(
		1 - sat,
		1 - sat,
		1 - sat,
		ct.alphaMultiplier,
		r * sat,
		g * sat,
		b * sat,
		ct.alphaOffset);
}

 

 

Or more compact:

 

function tintClip(clip, color, sat) {
	var ct:ColorTransform = clip.transform.colorTransform;
	clip.transform.colorTransform = new ColorTransform(1 - sat, 1 - sat, 1 - sat, ct.alphaMultiplier, (color >> 16) * sat, (color >> 8 & 0xFF) * sat, (color & 0xFF) * sat, ct.alphaOffset);
}

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 07, 2021 May 07, 2021

Copy link to clipboard

Copied

Thank you soo much!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 07, 2021 May 07, 2021

Copy link to clipboard

Copied

LATEST

I'm still having a little trouble with your code. I messed around with the saturation. and tried to get the image to change color from greyscale.

Essentially I just want to change the images base colors so that instead of say grey and dark grey. it would have red and dark red.

I tried to set the saturation to 1 and -1 but it just either inverts colors or brightens them.

Can you tell me how to call the function to get the desired result.

Essentially I want to be able to modify this.

Serifaz_1-1620429434496.png

 

To something like this.

Serifaz_0-1620429411770.png

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines