以下是一些可能有用的信息
- ;;; Copyright (C) 2003 by Autodesk, Inc.
- ;;;
- ;;; Permission to use, copy, modify, and distribute this software
- ;;; for any purpose and without fee is hereby granted, provided
- ;;; that the above copyright notice appears in all copies and
- ;;; that both that copyright notice and the limited warranty and
- ;;; restricted rights notice below appear in all supporting
- ;;; documentation.
- ;;;
- ;;; AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.
- ;;; AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
- ;;; MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC.
- ;;; DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
- ;;; UNINTERRUPTED OR ERROR FREE.
- ;;;
- ;;; Use, duplication, or disclosure by the U.S. Government is subject to
- ;;; restrictions set forth in FAR 52.227-19 (Commercial Computer
- ;;; Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii)
- ;;; (Rights in Technical Data and Computer Software), as applicable.
- ;;;
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;;
- ;; This file contains lisp utilities for dealing with true color in AutoCAD.
- ;;
- ;; AutoCAD describes true color with 24 bit integer values where
- ;; - blue is the first byte
- ;; - green is the second and
- ;; - red is the third byte
- ;;
- ;; (Careful... This is not exactly a RGB value. It is a BGR.)
- ;;
- ;; Within the scope of this file, the term "TrueColor" refers to one of these 24 bit
- ;; values. The term "ColorIndex" will be used to refer to the traditional AutoCAD
- ;; colors that range from 0 through 256 (where 0 and 256 have the special meanings of
- ;; "ByBlock" and "ByLayer" respectively)
- ;;
- ;;-------------------------------------
- ;; Entity lists and dxf group codes:
- ;;-------------------------------------
- ;; DXF
- ;; 62 - ColorIndex values are still represented with the 62 dxf group code (same as in
- ;; previous AutoCAD releases).
- ;;
- ;; 420 - TrueColor values are associated with the new 420 dxf group code.
- ;; For example: You might find (420 . 255) within the entity list of a blue entity.
- ;;
- ;; 430 - Contains a color book and color name description string. This is used only for
- ;; informational purposes. Actual entity color is governed by 62 and/or 420 group
- ;; codes.
- ;;
- ;;Entity lists...
- ;;
- ;; Entget:
- ;; No 62 pair present - If no 62 group code is present then the object's color is assumed to be
- ;; ByLayer. In other words; No behavior change from previous releases.
- ;; (The 420 and 430 pairs will not be present either)
- ;;
- ;; 62 only - Object's color is by ColorIndex (also refered to as ByACI)
- ;;
- ;; 62 and 420 - Object's color is TrueColor and is fully described by the 420 group code.
- ;; The 62 pair will contain the colorindex that most closely matches the true
- ;; color.
- ;;
- ;; 62, 420 and 430 - Object color was chosen from a color book. The 430 contains a textual description
- ;; of the form "'colorbook$colorname". The 420 pair describes the
- ;; corresponding truecolor and the 62 contains the closest matching color
- ;; index.
- ;;
- ;;
- ;; Entmod and Entmake:
- ;; The 420 group code takes precedence over the 62 group code. That is; entmake or entmod will
- ;; use the 420 group code if it is present and will ignore the 62 group code in the provided
- ;; entity list. If a 420 is _not_ present in the entity list, then the 62 group code will
- ;; be used. The 430 group code is for informational purposes only and does not have
- ;; any effect on displayed color.
- ;;
- ;;-------------------------------------
- ;; Two new built in lisp functions: Acad_TrueColorDlg and Acad_TrueColorCli
- ;;-------------------------------------
- ;;
- ;; Acad_TrueColorDlg is somewhat similar to the existing acad_colordlg function.
- ;; Signature:
- ;; (acad_truecolordlg color [allowbylayer] [currentlayercolor])
- ;;
- ;; Where "color" is a dotted pair that describes the default color. The first element
- ;; of the dotted pair must be one of the color dxf group codes (62, 420, or 430).
- ;; For example:
- ;; (62 . ColorIndex)
- ;; (420 . TrueColor)
- ;; (430 . "colorbook$colorname")
- ;;
- ;; If the optional [allowbylayer] parameter is present and non-nil, then the bylayer and
- ;; byblock buttons will be enabled. If this parameter is missing, the value defaults to
- ;; T and the bylayer/bylbock buttons will be enabled.
- ;;
- ;; The optional [curLayerColor] parameter controls the color of the bylayer/byblock color
- ;; in the dialog. This parameter is also a dotted pair like the first color parameter.
- ;;
- ;; Returns nil if the user canceled.
- ;; On success, the function returns a list of one or more dotted pairs that fully describe the
- ;; chosen color. The last dotted pair in this list indicates, specifically, the color that was
- ;; chosen. Additional details on the return list follow...
- ;;
- ;; ColorBook color - If the last item in the returned list is a 430 pair, then the specified
- ;; color originates from a colorbook. (This returned list will also contain
- ;; a 420 pair that describes the corresponding truecolor and a 62 pair that
- ;; describes the closest matching colorindex value.)
- ;;
- ;; True Color - If the returned list contains a 420 pair as the last item, then
- ;; a true color was specified (as "Red,Green,Blue"). The list will
- ;; also contain a 62 pair that indicates the closest matching colorindex.
- ;; (No 430 pair will be present)
- ;;
- ;; Color Index - If the last item in the list is a 62 pair, then a colorindex was chosen.
- ;; (no other dotted pairs will be present in the returned list)
- ;;
|