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 8861871
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T15:35:24+00:00 2026-06-14T15:35:24+00:00

I am using color transformation to set color on a view using this code

  • 0

I am using color transformation to set color on a view using this code in OL 3.3 this works perfecty fine.

obj.setColorTransform({ab: 0, aa: 100, 
                                bb: b-rB, ba: 100, 
                                gb: g-rG,  ga: 100, 
                                rb: r-rR,  ra: 100}); 

But i am facing the problem when i have upgraded it to 5.0 swf runtime

obj.setAttribute('colortransform',{ab: 0, aa: 100, 
                                bb: b-rB, ba: 100, 
                                gb: g-rG,  ga: 100, 
                                rb: r-rR,  ra: 100});  

The obj here is a view in this format,

  <view name="borders" 
              width="${parent.bg.width}"
              height="${parent.bg.height}" 
              y="10">
           <simplelayout axis="x"/>
           <view name="left" 
                 resource="border_left" 
                 stretches="height" 
                 height="${parent.height}" 
                 x="5" 
                 y="1">
              </view>
           <view name="middle" 
                 resource="border_mid" 
                 y="1"
                 stretches="width" 
                 height="${parent.height - 2}" 
                 width="${parent.width - parent.left.width - parent.right.width}">
           </view>
           <view name="right" 
                 resource="border_right" 
                 stretches="height" 
                 height="${parent.height}">
           </view>
        </view>

Any Idea why this is not working?

  • 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-06-14T15:35:26+00:00Added an answer on June 14, 2026 at 3:35 pm

    The API has changed, when the setColorTransform({}) method was deprecated in favor of the .setAttribute('colortransform', {}). Instead of ra or rb the property keys are now redMultiplier, redOffset. See the corresponding doc sections quoted below.

    Another change in the API is the values. Quoting the documentation for setColorTransform():

    The dictionary has the following possible keys: o.ra: percentage alpha
    for red component (-100 to 100); o.rb: offset for red component (-255
    to 255); o.ga: percentage alpha for green component (-100 to 100);
    o.gb: offset for green component (-255 to 255); o.ba: percentage alpha
    for blue component (-100 to 100); o.bb: offset for blue component
    (-255 to 255); o.aa: percentage overall alpha (-100 to 100); o.ab:
    overall offset (-255 to 255);

    Compare that with the documentation of a view’s colortransform attribute:

    The dictionary has the following possible keys: o.redMultiplier:
    multiplier for red component (0 to 1) defaults to 1 o.redOffset:
    offset for red component (-255 to 255) defaults to 0
    o.greenMultiplier: multiplier for green component (0 to 1) defaults to
    1 o.greenOffset: offset for green component (-255 to 255) defaults to
    0 o.blueMultiplier: multiplier for blue component (0 to 1) defaults to
    1 o.blueOffset: offset for blue component (-255 to 255) defaults to 0
    o.alphaMultiplier: multiplier for alpha component (0 to 1) defaults to
    1 o.alphaOffset: offset for alpha component (-255 to 255) defaults to
    0

    As you can see from the docs, the value range for the alpha offset changed from -100 to 100 to 0 to 1. The following syntax works when you use setAttribute:

    var transformValues =
            {redMultiplier: 0 to 1,    redOffset: -255 to 255,
             greenMultiplier: 0 to 1,  greenOffset: -255 to 255,
             blueMultiplier: 0 to 1,   blueOffset: -255 to 255,
             alphaMultiplier: 0 to 1,  alphaOffset: -255 to 255}
    this.setAttribute('colortransform', transformValues);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using prettify for color coding but my code is still flat and not
Im trying to generate a color gradient using ColdFusion. My current code below works
I jave a Javascript code that draws a shape with specific color using style.backgroundColor=.
When plotting color-maps using gnuplot, I usually use the following lines: ... set palette
Okay so I figured out the whole color business using HTML, but now when
How should I be using color in my application? I have over a 100
In my program I can not view tiff file by using color box,I am
I'm working with an image retrieval system using color histogram intersection in MATLAB. This
Is this possible? I know it's possible in the command prompt using COLOR ##
What is the easiest way to alternate a row color using RichFaces dataTable component?

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.