|
[code];;;把truecolordlg
;;;420构成的数值返回RGB列表
;;;==========================
(defun Number->RGB (color)
(list (lsh color -16)
(lsh (lsh color 16) -24)
(lsh (lsh color 24) -24)
)
)
;;;==========================
;;;把truecolordlg
;;;420构成的数值返回RGB列表.
;;;==========================
(defun RGB->Number (R G B)
(+ (lsh R 16) (lsh G 8) B)
)
;;;==========================
;;;RGB转化成索引号
;;;==========================
(defun RGB->Index (ColorObj r g b /)
(if (and (equal 0 r 10) (equal 0 g 10) (equal 0 b 10))
0
(progn
(vla-setRGB ColorObj r g b)
(vla-get-ColorIndex ColorObj)
)
)
)
;;;==========================
;;;索引号转化成RGB
;;;==========================
(defun Index->RGB (ColorObj ci /)
(vla-put-ColorIndex ColorObj ci)
(list (vla-get-red ColorObj)
(vla-get-green ColorObj)
(vla-get-blue ColorObj)
)
)[/code] |
|