Appearance of ObjectsJオブジェクトの外観と表現シンデレラの描画エンジンは、点、直線、文字などの要素を表示するときの外観の初期設定を持っています。描画命令が修飾子なしで実行されるときは初期設定が用いられます。これは、視覚的な統一を図るのに便利です。外観として主なものは 色, 大きさ, そして 透明度です。 表現データの一時保存:
|
| color: | vector: |
| black | (0,0,0) |
| red | (1,0,0) |
| green | (0,1,0) |
| blue | (0,0,1) |
| cyan | (0,1,1) |
| magenta | (1,0,1) |
| yellow | (1,1,0) |
| white | (1,1,1) |
pointcolor() , linecolor() , textcolor() の3つの演算子で設定できます。さらに、 color() 演算子はすべてのオブジェクトの色を同時に設定します。
n=13;
ind=1..n;
pointsize(9);
forall(ind,i,
forall(ind,j,
pointcolor((i/n,j/n,0));
draw((i,j),noborder->true);
pointcolor((0,i/n,j/n));
draw((i+15,j),noborder->true);
pointcolor((j/n,0,i/n));
draw((i+30,j),noborder->true);
)
)

alpha() によりすべての要素に設定されます。red() : で設定されます。green() : で設定されます。blue() : で設定されます。gray() : に設定した色ベクトルを作ります。hue() : は0から1までの数です。この値の範囲は色相環の範囲を表します。1より大きな値の場合には、色相環を何周かして色を決めます。n=360; ind=(1..n)/n; linesize(2); forall(ind, color(hue(#)); draw((0,0),(sin(#*2*pi),cos(#*2*pi))) )

Contributors to this page: Akira Iritani
.
Page last modified on Tuesday 06 of March, 2012 [10:51:36 UTC] by Akira Iritani.
The content on this page is licensed under the terms of the License.