Skip to content

Commit

Permalink
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Browse files Browse the repository at this point in the history
Fix `substring' arguments.  Recognize ``medium'' prefix.
  • Loading branch information
Richard M. Stallman committed Jun 2, 1996
1 parent d5526eb commit d5aa246
Showing 1 changed file with 151 additions and 30 deletions.
181 changes: 151 additions & 30 deletions lisp/term/pc-win.el
Expand Up @@ -26,34 +26,149 @@

(load "term/internal" nil t)

;; Color translation -- doesn't really need to be fast
;; Color translation -- doesn't really need to be fast.
;; Colors listed here do not include the "light-",
;; "medium-" and "dark-" prefixes that are accounted for
;; by `msdos-color-translate', which see below).

(defvar msdos-color-aliases
'(("purple" . "magenta")
("firebrick" . "red") ; ?
("pink" . "lightred")
("royalblue" . "blue")
("cadetblue" . "blue")
("forestgreen" . "green")
("darkolivegreen" . "green")
("darkgoldenrod" . "brown")
("goldenrod" . "yellow")
("grey40" . "darkgray")
("dark gray" . "darkgray")
("light gray" . "lightgray")
("rosybrown" . "brown")
("blue" . "lightblue") ;; from here: for Enriched Text
("darkslategray" . "darkgray")
("orange" . "brown")
("light blue" . "lightblue") ;; from here: for cpp-highlight
("light cyan" . "lightcyan")
("light yellow" . "yellow")
("light pink" . "lightred")
("pale green" . "lightgreen")
("beige" . "brown")
("medium purple" . "magenta")
("turquoise" . "lightgreen")
("violet" . "magenta"))
'(("snow" . "white")
("ghost white" . "white")
("ghostwhite" . "white")
("white smoke" . "white")
("whitesmoke" . "white")
("gainsboro" . "white")
("floral white" . "white")
("floralwhite" . "white")
("old lace" . "white")
("oldlace" . "white")
("linen" . "white")
("antique white" . "white")
("antiquewhite" . "white")
("papaya whip" . "white")
("papayawhip" . "white")
("blanched almond" . "white")
("blanchedalmond" . "white")
("bisque" . "white")
("peach puff" . "lightred")
("peachpuff" . "lightred")
("navajo white" . "lightred")
("navajowhite" . "lightred")
("moccasin" . "lightred")
("cornsilk" . "white")
("ivory" . "white")
("lemon chiffon" . "yellow")
("lemonchiffon" . "yellow")
("seashell" . "white")
("honeydew" . "white")
("mint cream" . "white")
("mintcream" . "white")
("azure" . "lightcyan")
("alice blue" . "lightcyan")
("aliceblue" . "lightcyan")
("lavender" . "lightcyan")
("lavender blush" . "lightcyan")
("lavenderblush" . "lightcyan")
("misty rose" . "lightred")
("mistyrose" . "lightred")
("aquamarine" . "blue")
("cadet blue" . "blue")
("cadetblue" . "blue")
("cornflower blue" . "lightblue")
("cornflowerblue" . "lightblue")
("midnight blue" . "blue")
("midnightblue" . "blue")
("navy blue" . "cyan")
("navyblue" . "cyan")
("navy" . "cyan")
("sky blue" . "lightblue")
("skyblue" . "lightblue")
("dodger blue" . "blue")
("dodgerblue" . "blue")
("powder blue" . "lightblue")
("powderblue" . "lightblue")
("slate blue" . "cyan")
("slateblue" . "cyan")
("steel blue" . "blue")
("steelblue" . "blue")
("coral" . "lightred")
("firebrick" . "red")
("gold" . "yellow")
("goldenrod" . "yellow")
("pale goldenrod" . "yellow")
("palegoldenrod" . "yellow")
("olive green" . "lightgreen")
("olivegreen" . "lightgreen")
("olive drab" . "green")
("olivedrab" . "green")
("forest green" . "green")
("forestgreen" . "green")
("lime green" . "lightgreen")
("limegreen" . "lightgreen")
("sea green" . "lightcyan")
("seagreen" . "lightcyan")
("spring green" . "green")
("springgreen" . "green")
("pale green" . "lightgreen")
("palegreen" . "lightgreen")
("lawn green" . "lightgreen")
("lawngreen" . "lightgreen")
("chartreuse" . "yellow")
("yellow green" . "lightgreen")
("yellowgreen" . "lightgreen")
("green yellow" . "lightgreen")
("greenyellow" . "lightgreen")
("slate grey" . "lightgray")
("slategrey" . "lightgray")
("slate gray" . "lightgray")
("slategray" . "lightgray")
("dim grey" . "darkgray")
("dimgrey" . "darkgray")
("dim gray" . "darkgray")
("dimgray" . "darkgray")
("light grey" . "lightgray")
("lightgrey" . "lightgray")
("light gray" . "lightgray")
("gray" . "darkgray")
("grey" . "darkgray")
("gray80" . "darkgray")
("gray50" . "black")
("gray90" . "darkgray")
("khaki" . "green")
("maroon" . "red")
("orange" . "brown")
("orchid" . "brown")
("saddle brown" . "red")
("saddlebrown" . "red")
("sienna" . "red")
("peru" . "red")
("pink" . "lightred")
("plum" . "magenta")
("indian red" . "red")
("indianred" . "red")
("violet red" . "magenta")
("violetred" . "magenta")
("orange red" . "red")
("orangered" . "red")
("salmon" . "lightred")
("sienna" . "lightred")
("tan" . "lightred")
("thistle" . "magenta")
("turquoise" . "lightgreen")
("pale turquoise" . "cyan")
("paleturquoise" . "cyan")
("violet" . "magenta")
("blue violet" . "lightmagenta")
("blueviolet" . "lightmagenta")
("wheat" . "white")
("green yellow" . "yellow")
("greenyellow" . "yellow")
("purple" . "magenta")
("royalblue" . "blue")
("grey40" . "darkgray")
("rosybrown" . "brown")
("rosy brown" . "brown")
("beige" . "brown"))
"List of alternate names for colors.")

(defun msdos-color-translate (name)
Expand All @@ -67,18 +182,24 @@
(and (setq try (cdr (assoc name msdos-color-aliases)))
(msdos-color-translate try))
(and (> len 5)
(string= "light" (substring name 0 4))
(string= "light" (substring name 0 5))
(setq try (msdos-color-translate (substring name 5)))
(logior try 8))
(and (> len 6)
(string= "light " (substring name 0 5))
(string= "light " (substring name 0 6))
(setq try (msdos-color-translate (substring name 6)))
(logior try 8))
(and (> len 6)
(string= "medium" (substring name 0 6))
(msdos-color-translate (substring name 6)))
(and (> len 7)
(string= "medium " (substring name 0 7))
(msdos-color-translate (substring name 7)))
(and (> len 4)
(string= "dark" (substring name 0 3))
(string= "dark" (substring name 0 4))
(msdos-color-translate (substring name 4)))
(and (> len 5)
(string= "dark " (substring name 0 4))
(string= "dark " (substring name 0 5))
(msdos-color-translate (substring name 5))))))
;; ---------------------------------------------------------------------------
;; We want to delay setting frame parameters until the faces are setup
Expand Down

0 comments on commit d5aa246

Please sign in to comment.