イナヅマTVログ

com.quasimondo.geom.ColorMatrix v2.1がステキ

| 0件のコメント

Hydrotweenのcolor(色)tweenにバグがあったおかげで、ColorMatrixを集中的に調べることができた。
普段何気なく使っているグラフィックツールに同じ機能があったり、勉強になった。

また、Mario KlingemannさんのColorMatrixクラスに巡り会えた幸せな旅だった。
Nomadic FunctionsのJavaScriptで作られたColorMarix関数は感激もの。
輝度(Luminance)の不思議にも出会うことができたのは大収穫。

com.quasimondo.geom.ColorMatrixを試しに使ってみた。
全部試してはないけど、どうも相当イケテル予感。
com.gskinner.geom.ColorMatrixでドギモを抜かれたけどそれ以上かも・・・
Saturation, Contrast, Brightness, Hue はもちろん Invertも一発、他にもどう使うのかまだ理解できないrotateHueなんて関数も用意されていて、超強力布陣。
グラフィックの勉強をちゃんとしないと使いこなせそうにナイ。

[swfobj src=”http://www.inazumatv.com/contents/wp-content/uploads/2008/09/colormatrix-0.swf” width=”600″ height=”500″ id=”ColorMatrix-Examples” name=”ColorMatrix-Examples” allowfullscreen=”false” required_player_version=”9.0.124″]

5×4のMatrixを生成するのでColorMarixFilterにセットして使いなナ感じ。
引数の値の範囲がよくわからない関数がある、さらに検証。。。
緑のワクがオリジナル。

import com.quasimondo.geom.ColorMatrix;
 
var cm:ColorMatrix = new ColorMatrix();
cm.invert();
target0.filters = [new ColorMatrixFilter(cm.matrix)];
 
cm.reset();
cm.adjustSaturation(-2);
target1.filters = [new ColorMatrixFilter(cm.matrix)];
 
cm.reset();
cm.adjustSaturation(2);
target2.filters = [new ColorMatrixFilter(cm.matrix)];
 
cm.reset();
cm.adjustContrast(-1);
target3.filters = [new ColorMatrixFilter(cm.matrix)];
 
cm.reset();
cm.adjustContrast(1);
target4.filters = [new ColorMatrixFilter(cm.matrix)];
 
cm.reset();
cm.adjustBrightness(128);
target5.filters = [new ColorMatrixFilter(cm.matrix)];
 
cm.reset();
cm.adjustBrightness(0,128);
target6.filters = [new ColorMatrixFilter(cm.matrix)];
 
cm.reset();
cm.adjustBrightness(0,0,128);
target7.filters = [new ColorMatrixFilter(cm.matrix)];
 
cm.reset();
cm.adjustHue(90);
target8.filters = [new ColorMatrixFilter(cm.matrix)];
 
cm.reset();
cm.adjustHue(180);
target9.filters = [new ColorMatrixFilter(cm.matrix)];
 
cm.reset();
cm.adjustHue(-90);
target10.filters = [new ColorMatrixFilter(cm.matrix)];
 
cm.reset();
cm.rotateHue(90);
target11.filters = [new ColorMatrixFilter(cm.matrix)];
 
cm.reset();
cm.rotateHue(180);
target12.filters = [new ColorMatrixFilter(cm.matrix)];
 
cm.reset();
cm.rotateHue(270);
target13.filters = [new ColorMatrixFilter(cm.matrix)];
 
cm.reset();
cm.luminance2Alpha();
target14.filters = [new ColorMatrixFilter(cm.matrix)];
 
cm.reset();
cm.setChannels();
target15.filters = [new ColorMatrixFilter(cm.matrix)];
 
cm.reset();
cm.setAlpha(0.5);
target16.filters = [new ColorMatrixFilter(cm.matrix)];
 
cm.reset();
cm.averageRGB2Alpha();
target17.filters = [new ColorMatrixFilter(cm.matrix)];
 
cm.reset();
cm.invertAlpha();
target18.filters = [new ColorMatrixFilter(cm.matrix)];
 
cm.reset();
cm.rgb2Alpha(0,1,1);
target19.filters = [new ColorMatrixFilter(cm.matrix)];
 
cm.reset();
cm.rgb2Alpha(1,0,1);
target20.filters = [new ColorMatrixFilter(cm.matrix)];
 
cm.reset();
cm.rgb2Alpha(1,1,0);
target21.filters = [new ColorMatrixFilter(cm.matrix)];
 
cm.reset();
cm.rgb2Alpha(.5,.5,.5);
target22.filters = [new ColorMatrixFilter(cm.matrix)];

コメントを残す

必須欄は * がついています


このサイトはスパムを低減するために Akismet を使っています。コメントデータの処理方法の詳細はこちらをご覧ください