fuccaro Posted November 11, 2008 Posted November 11, 2008 Thank you for returning with a feed-back! Have a nice day too! Quote
ASMI Posted November 11, 2008 Posted November 11, 2008 This functions for RGB AutoCAD bits translation can be usefull. (defun RGB->Bits(RGB_List) (if(vl-every '(lambda(c)(and(< -1 c)(> 256 c)))RGB_List) (apply '+(mapcar '* RGB_List '(65536 256 1))) ); end if ); end of RGB->Bits (defun Bits->RGB(Bits / r g) (if(and(< -1 Bits)(> 16777216 Bits)) (list(setq r(/ Bits 65536)) (setq g(/(- Bits(* r 65536))256)) (- Bits(+(* r 65536)(* g 256))) ); end list ); end if ); end Bits->RGB For example Magenta color (255 0 255) to bits: _$ (RGB->Bits '(255 0 255)) 16711935 And back Magenta bits to RGB list: _$ (Bits->RGB 16711935) (255 0 255) Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.