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

Can't get 256 colors



I am having trouble accessing the 256 colors that are supposed to be
available on my Mac IIx.  I'm using Quickdraw in MCL 2.0, and the
function ccl:with-fore-color.  I am sure that my screen supports 256
colors, because I selected that choice from the "Monitors" control panel,
and the palette at the bottom of that panel displayed 256 different colors.

It seems that ccl:real-color-equal distinguishes among 256 different color
values, but when I display them in a window, there only seem to be about
six or seven different colors.  After generating all possible six-digit
hexidecimal numbers (sampling every tenth one, actually), and removing
duplicates that caused ccl:real-color-equal to return T, I was left with
the following list:

(setf all-colors '(
 15996928 15047910 15047860 15047810 15047760 15047720 15047680
 15005936 15005876 15005826 15005776 15005736 15005696 14754022
 14753972 14753922 14753872 14753832 14753792 14770406 14770356
 14770306 14770256 14770216 14770176 14728422 14728372 14728322
 14728272 14728232 14728192 14686438 14686388 14686338 14686288
 14686248 14686208 14030848 13821158 12720128 11981010 11981000
 11813094 11813044 11812994 11812944 11812904 11812864 11771110
 11771060 11771010 11770960 11770920 11770880 11729126 11729076
 11729026 11728976 11728936 11728896 11645158 11645058 11645008
 11644968 11644928 11603174 11603124 11603074 11603024 11602984
 11602944 11561190 11561140 11561090 11561040 11561000 11560960
 10796212 10754048 9443328 8561824 8788198 8788148 8788098 8788048
 8788008 8787968 8704230 8704180 8704130 8704080 8704040 8704000
 8536294 8536244 8536194 8536144 8536104 8536064 8494310 8494260
 8494230 8494160 8494120 8494080 8452326 8452276 8452226 8452176
 8452136 8452096 8410342 8410292 8410242 8410192 8410152 8410112
 7964802 7477248 6360064 5511398 5511348 5511298 5511248 5511208
 5511168 5469414 5469364 5469314 5469304 5469284 5469224 5469184
 5427430 5427380 5427330 5427280 5427240 5427200 5343462 5343412
 5343362 5343312 5343272 5343232 5301478 5301428 5301378 5301328
 5301288 5301248 5259494 5259444 5259394 5259364 5259304 5259264
 4478032 4200448 3545088 2637894 2554086 2554036 2553986 2553936
 2553896 2553856 2176050 2134246 2134196 2134146 2134096 2134056
 2134016 2234598 2234548 2234498 2234448 2234418 2234368 2192614
 2192564 2192514 2192464 2192424 2192384 2150630 2150580 2150530
 2150480 2150440 2150400 2108646 2108596 2108546 2108496 2108416
 1453096 1453076 1117184 923648 755712 587776 545792 503808 419840
 377856 335872 294118 294068 294018 293968 293928 293888 252134 252084
 252034 251984 251944 251904 209920 167936 126182 126132 126082 126032
 125992 125952 84198 84148 84098 84048 84008 83968 42214 42164 42114
 42064 42024 41984 240 230 210 200 180 160 150 130 120 100 80 70 50 40
 20 0))

Sure enough, you can see that (ccl:real-color-equal 0 20) returns NIL, so I
believe that this list is accurate, as far as Quickdraw can determine.
However, when I display these colors in my window, there are only about
seven unique colors.  I used these functions to draw different colored lines
in a window:

;; Draws all colors in ALL-COLORS
(defun do-colors ()
    (let ((drawable your-mac-window)
          (x -1))
      (dolist (c all-colors)
        (ccl:with-focused-view drawable
          (ccl:with-fore-color c
            (ccl:move-to drawable (incf x) 20)
            (ccl:line-to drawable x 70))))))

;; Draws the Nth color in ALL-COLORS
(defun do-color (n)
  (let ((drawable your-mac-window)
        (c (nth n all-colors)))
    (ccl:with-focused-view drawable
      (ccl:with-fore-color c
        (ccl:move-to drawable n 50)
        (ccl:line-to drawable n 100)))))

At the right end of the "spectrum", there is a solid region of black for the
colors 0-120, and then there is a solid blue region for the colors 140-240.
The rest of the spectrum is broken up into similar irregular blocks.

Furthermore, I am not even able to get differences among the predefined
colors exported from Quickdraw.  The colors *black-color*, *dark-green-color*,
*brown-color*, and *dark-gray-color* all appear black, for example.

Am I required to do something else to get the 256 unique colors?
Any insight would be appreciated.  Thanks,

--Andrew Mickish