Originally Posted by
Dave Lewis
I need the code to say if the background text is white to change it to this color.
JTB's done all of the hard work for you (linky):
Code:
(if (= 7 (getTextWinTextColor))
(prompt "\n** Command line text is white ** ")
)
Required sub-functions:
Code:
(defun getTextWinTextColor()
(OLE_color->ACI_color
(vla-get-TextWinTextColor
(vla-get-display (vla-get-preferences (vlax-get-acad-object)))))
)
(defun OLE_color->ACI_color (olec)
(vl-position
(boole 1
(vlax-variant-value
(vlax-variant-change-type olec vlax-vbLong)
)
16777215
)
OLE_COLOR_LIST
)
)
(setq OLE_COLOR_LIST
'(0 255 65535 65280 16776960
16711680 16711935 16777215 8421504 12632256
255 8421631 166 5460902 128
4210816 76 2500172 38 1250086
16639 8429567 10662 5466278 8320
4214912 4940 2502732 2598 1251366
33023 8437759 21414 5471398 16512
4219008 9804 2505036 4902 1252646
49151 8445951 31910 5476774 24704
4223104 14668 2507596 7462 1253670
65535 8454143 42662 5482150 32896
4227200 19532 2509900 9766 1254950
65471 8454111 42620 5482129 32864
4227184 19513 2509891 9757 1254945
65408 8454079 42579 5482108 32832
4227168 19494 2509881 9747 1254941
65344 8454047 42537 5482088 32800
4227152 19475 2509872 9738 1254936
65280 8454016 42496 5482067 32768
4227136 19456 2509862 9728 1254931
4259584 10485632 2729472 6858323 2129920
5275712 1264640 3165222 665088 1582611
8453888 12582784 5481984 8169043 4227072
6324288 2509824 3755046 1254912 1910291
12582656 14679936 8168960 9545299 6324224
7372864 3755008 4410406 1910272 2172435
16776960 16777088 10921472 10921555 8421376
8421440 5000192 5000230 2500096 2500115
16760576 16768896 10910720 10916179 8413184
8417344 4995328 4997926 2497792 2498835
16744448 16760704 10900224 10910803 8404992
8413248 4990464 4995366 2495232 2497811
16728064 16752512 10889472 10905683 8396800
8409152 4985600 4993062 2492928 2496531
16711680 16744576 10878976 10900307 8388608
8405056 4980736 4990502 2490368 2495251
16711744 16744607 10879017 10900328 8388640
8405072 4980755 4990512 2490378 2495256
16711808 16744639 10879059 10900348 8388672
8405088 4980774 4990521 2490387 2495261
16711871 16744671 10879100 10900369 8388704
8405104 4980793 4990531 2490397 2495265
16711935 16744703 10879142 10900390 8388736
8405120 4980812 4990540 2490406 2495270
12517631 14647551 8126630 9524134 6291584
7356544 3735628 4400716 1900582 2167590
8388863 12550399 5439654 8147878 4194432
6307968 2490444 3745356 1245222 1905446
4194559 10453247 2687142 6837158 2097280
5259392 1245260 3155532 655398 1577766
5526612 5987163 10000536 12303291 14540253
16777215
)
)