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

How can I access the advanced color effects through actionscript

New Here ,
May 06, 2021 May 06, 2021

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.pngexpand image

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.

1.4K
Translate
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.

Translate
LEGEND ,
May 06, 2021 May 06, 2021
Translate
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

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

Translate
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

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

Translate
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

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

Translate
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

 

// 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);
}

 

Translate
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

Thank you soo much!

Translate
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
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.pngexpand image

 

To something like this.

Serifaz_0-1620429411770.pngexpand image

 

Translate
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