VS:RGBToColorIndexN/ja

From Vectorworks Developer
Jump to navigation Jump to search

.VectorScript|VectorScript ..VS:Function Reference|Function Reference ..VS:Function_Reference_Appendix|Appendix

Description

各色の成分に一番近いカラーパレットの色番号を返します。値の範囲は0から65535までです。ignoreBlackBackgroundパラメータは背景色を黒にする設定を無視するか否かを設定します。TRUEに設定すると、白と黒のインデックスは背景色が黒であっても逆にされません。


A color table listing with associated index values can be found in the <A HREF="../Appendix/appendix.html#colors">Appendix</A>.

PROCEDURE RGBToColorIndexN(
red :LONGINT;
green :LONGINT;
blue :LONGINT;
VAR color :INTEGER;
ignoreBlackBackground :BOOLEAN);
def vs.RGBToColorIndexN(red, green, blue, ignoreBlackBackground):
    return color

Parameters

red LONGINT 赤の成分
green LONGINT 緑の成分
blue LONGINT 青の成分
color INTEGER 色番号
ignoreBlackBackground BOOLEAN 背景色を黒にする設定を無視する設定

Example

PROCEDURE Example;
VAR
	red, green, blue :LONGINT;
	colorIndex :INTEGER;
BEGIN
	GetPenFore(FSActLayer, red, green, blue);
	RGBToColorIndexN(red, green, blue, colorIndex, TRUE);
	Message(colorIndex);
END;
RUN(Example)

Version

利用可能バージョン: Vectorworks 2010