[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: main-screen-color-p



>Date: Wed, 26 Aug 92 11:04:51 EDT
>From: wilcox@cmns.think.com
>To: info-mcl@cambridge.apple.com
>Subject: main-screen-color-p
>
>Here's a quick way to tell if the main screen can display in color:
>
>(defun main-screen-color-p ()
>  "Is the main screen capable of displaying color?"
>  ;; *color-available* just tells you if color quickdraw is in ROM
>  ;; it doesn't tell you if the screen can display in color
>  ;; #_getmaindevice trap gives handle to screen containing menubar
>  (let ((screen (#_getmaindevice))
>        (gddevtype 0))
>    (#_testdeviceattribute screen gddevtype)
>    ))

If you run this code on a machine where *color-available* is NIL,
it will crash. Better would be:

(defun main-screen-color-p ()
  "Is the main screen capable of displaying color?"
  ;; *color-available* just tells you if color quickdraw is in ROM
  ;; it doesn't tell you if the screen can display in color
  ;; #_getmaindevice trap gives handle to screen containing menubar
  (and *color-available*
       (let ((screen (#_getmaindevice))
             (gddevtype 0))
         (#_testdeviceattribute screen gddevtype)
         )))

>Date: Wed, 26 Aug 92 11:35:14 -0400
>From: Henry Lieberman <lieber@MEDIA-LAB.MEDIA.MIT.EDU>
>To: info-mcl@MEDIA-LAB.MEDIA.MIT.EDU
>Subject: main-screen-color-p
>
>
>Main-Screen-Color-P still doesn't do it, I'm afraid. 
>On my machine, a color screen, it returns T, but when I set the
>Monitors control panel to black-and-white, it still returns T.
>
>I think what most programs will want to know is whether color pixels
>are actually reaching the user's retina, not if the screen has the
>"capability" in some sense to do color display.

It does the right thing in my hardware setup. Changing between 256 colors
and 256 grays toggles the value returned. I've got an 8*24 GC board
going to my color monitor. Maybe your monitor interface hardware is
doing the wrong thing.

For those of you with CD-ROM drives, there are a number of unexported
functions having to do with graphics devices at the end of the file:

   "MCL 2.0 CD:Additional MCL Source Code:Lib:color.lisp"