Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6585287
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T16:38:37+00:00 2026-05-25T16:38:37+00:00

I have a bitmap (bitmapData) that I’d like it to change colors over time.

  • 0

I have a bitmap (bitmapData) that I’d like it to change colors over time. I’ve seen examples of applying a color transform and I couldn’t get it to work. Also, with those examples they only apply one color. I would like to animate through the ROYGBIV range. Note: I am dynamically loading images. I don’t want to tint the image I want the color in the image to change if that makes sense.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T16:38:38+00:00Added an answer on May 25, 2026 at 4:38 pm

    To manipulate/tint colors you would use the colorTransform function

    To illustrate:
    In the example below I embed the image and reference it, if you are using adobe flash you would ‘name’ your asset and reference it in you code.

        import flash.geom.ColorTransform;
        import flash.events.Event;
        import flash.display.Bitmap;
    
        [Embed(source="img/logo.png")] private var logoCls:Class;
        private var bitmapLogo:Bitmap = new logoCls();
    
        public function Test()
        {
            addEventListener(Event.ADDED_TO_STAGE, init);
            addEventListener(Event.ENTER_FRAME, onEnterFrame);
        }
    
        private function init(e:Event):void
        {
            removeEventListener(Event.ADDED_TO_STAGE, init);
            addChild(bitmapLogo);
        }
    
        // r, g, b colors
        var r:int = 256; // start at Red
        var g:int = 0;
        var b:int = 0;
        var increment:int = 16; // how quickly to change the color
        var colorCycle:int = 0; 
        var mult:Number = 0.25; // How heavily TINTED you want the image
    
        private function onEnterFrame(e:Event):void
        {
            var ct:ColorTransform = new ColorTransform (1-mult,1-mult,1-mult,1,r*mult,g*mult,b*mult,0);
            bitmapLogo.transform.colorTransform = ct;
            incrementRainbowColors();
        }
        private function incrementRainbowColors():void
        {
            if (colorCycle == 0) // -> yellow
                if ((g+=increment) >= 256) colorCycle=1;
            else if (colorCycle == 1) // -> green
                if ((r-=increment) <= 0) colorCycle=2;
            else if (colorCycle == 2) // -> cyan
                if ((b+=increment) >=256) colorCycle=3;
            else if (colorCycle == 3) // -> blue
                if ((g-=increment) <= 0) colorCycle = 4;
            else if (colorCycle == 4) // -> magenta
                if ((r+=increment) >=256) colorCycle = 5;
            else if (colorCycle == 5) // -> red
                if ((b-=increment)<=0) colorCycle = 0;
        }
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have converted a PNG into a bitmap, then converted that into bitmapData. I
I have a method that I call and it returns bitmap data from a
We have Bitmap and Bitmapdata objects now. And when using the webcam, we can
I have a Bitmap that I want to enlarge programatically to ~1.5x or 2x
I have a 2D bitmap-like array of let's say 500*500 values. I'm trying to
I have a chart (in bitmap format) that I'm trying to render to a
I have some images that I loaded from a remote source stored in Bitmap
I have some code that does Bitmap manipulation using the LockBits method and accessing
I have a class that creates a matrix of Color values by reading a
I have been doing some unsafe bitmap operations and have found out that increasing

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.