I’m trying to create a composed color using a color choosed by me and another preset color that goes in overlay.
I’m trying to create a composed color using a color choosed by me and another preset color that goes in overlay.
To do this i used some android classes and this is the outcome:
var color = LL.pickColor(“”,some color,false);
var add = 0x9050…..;
var drawable = new ColorDrawable(color);
drawable.setColorFilter(add,PorterDuff.Mode.OVERLAY);
var col = drawable.getColor();
It gives me no error, but it returns always the choosed color.
I tried with other different PorterDuff modes and the result is always the same…
Am I doing something wrong or this is impracticable on LL?
Please i need a quick answer!!
EDIT: I did some research and i realized that setting a color filter on a ColorDrawable has no effect…
There is still another way to do the same thing??
]]>« hi All, hi Pierre Hébert (Previous Post)
(Next Post) There is a way to know if a script is still running? »
< ![CDATA[
What about something like
alert(average_color(Color.YELLOW, Color.BLUE));
function average_color(a,b){
return Color.argb(Color.alpha(a)/2+Color.alpha(b)/2,Color.red(a)/2+Color.red(b)/2,Color.green(a)/2+Color.green(b)/2,Color.blue(a)/2+Color.blue(b)/2)
}
]]>
< 
]]>
< 
]]>