31 #define VT_DEFAULT_NAME "default"
52 VT_DEFAULT_RGB_FG = 39,
53 VT_DEFAULT_RGB_BG = 49,
379 ColorLightGoldenrodYellow,
391 ColorMediumAquamarine,
396 ColorMediumSlateBlue,
397 ColorMediumSpringGreen,
398 ColorMediumTurquoise,
399 ColorMediumVioletRed,
446 #define COLOR_DEFAULT 0xc0dedead
474 #define RGB_COLOR_CODES { \
475 { ColorDefault , COLOR_DEFAULT }, \
476 { ColorBlack , 0x000000 }, \
477 { ColorMaroon , 0x800000 }, \
478 { ColorGreen , 0x008000 }, \
479 { ColorOlive , 0x808000 }, \
480 { ColorNavy , 0x000080 }, \
481 { ColorPurple , 0x800080 }, \
482 { ColorTeal , 0x008080 }, \
483 { ColorSilver , 0xC0C0C0 }, \
484 { ColorGray , 0x808080 }, \
485 { ColorRed , 0xFF0000 }, \
486 { ColorLime , 0x00FF00 }, \
487 { ColorYellow , 0xFFFF00 }, \
488 { ColorBlue , 0x0000FF }, \
489 { ColorFuchsia , 0xFF00FF }, \
490 { ColorAqua , 0x00FFFF }, \
491 { ColorWhite , 0xFFFFFF }, \
492 { Color16 , 0x000000 }, \
493 { Color17 , 0x00005F }, \
494 { Color18 , 0x000087 }, \
495 { Color19 , 0x0000AF }, \
496 { Color20 , 0x0000D7 }, \
497 { Color21 , 0x0000FF }, \
498 { Color22 , 0x005F00 }, \
499 { Color23 , 0x005F5F }, \
500 { Color24 , 0x005F87 }, \
501 { Color25 , 0x005FAF }, \
502 { Color26 , 0x005FD7 }, \
503 { Color27 , 0x005FFF }, \
504 { Color28 , 0x008700 }, \
505 { Color29 , 0x00875F }, \
506 { Color30 , 0x008787 }, \
507 { Color31 , 0x0087Af }, \
508 { Color32 , 0x0087D7 }, \
509 { Color33 , 0x0087FF }, \
510 { Color34 , 0x00AF00 }, \
511 { Color35 , 0x00AF5F }, \
512 { Color36 , 0x00AF87 }, \
513 { Color37 , 0x00AFAF }, \
514 { Color38 , 0x00AFD7 }, \
515 { Color39 , 0x00AFFF }, \
516 { Color40 , 0x00D700 }, \
517 { Color41 , 0x00D75F }, \
518 { Color42 , 0x00D787 }, \
519 { Color43 , 0x00D7AF }, \
520 { Color44 , 0x00D7D7 }, \
521 { Color45 , 0x00D7FF }, \
522 { Color46 , 0x00FF00 }, \
523 { Color47 , 0x00FF5F }, \
524 { Color48 , 0x00FF87 }, \
525 { Color49 , 0x00FFAF }, \
526 { Color50 , 0x00FFd7 }, \
527 { Color51 , 0x00FFFF }, \
528 { Color52 , 0x5F0000 }, \
529 { Color53 , 0x5F005F }, \
530 { Color54 , 0x5F0087 }, \
531 { Color55 , 0x5F00AF }, \
532 { Color56 , 0x5F00D7 }, \
533 { Color57 , 0x5F00FF }, \
534 { Color58 , 0x5F5F00 }, \
535 { Color59 , 0x5F5F5F }, \
536 { Color60 , 0x5F5F87 }, \
537 { Color61 , 0x5F5FAF }, \
538 { Color62 , 0x5F5FD7 }, \
539 { Color63 , 0x5F5FFF }, \
540 { Color64 , 0x5F8700 }, \
541 { Color65 , 0x5F875F }, \
542 { Color66 , 0x5F8787 }, \
543 { Color67 , 0x5F87AF }, \
544 { Color68 , 0x5F87D7 }, \
545 { Color69 , 0x5F87FF }, \
546 { Color70 , 0x5FAF00 }, \
547 { Color71 , 0x5FAF5F }, \
548 { Color72 , 0x5FAF87 }, \
549 { Color73 , 0x5FAFAF }, \
550 { Color74 , 0x5FAFD7 }, \
551 { Color75 , 0x5FAFFF }, \
552 { Color76 , 0x5FD700 }, \
553 { Color77 , 0x5FD75F }, \
554 { Color78 , 0x5FD787 }, \
555 { Color79 , 0x5FD7AF }, \
556 { Color80 , 0x5FD7D7 }, \
557 { Color81 , 0x5FD7FF }, \
558 { Color82 , 0x5FFF00 }, \
559 { Color83 , 0x5FFF5F }, \
560 { Color84 , 0x5FFF87 }, \
561 { Color85 , 0x5FFFAF }, \
562 { Color86 , 0x5FFFD7 }, \
563 { Color87 , 0x5FFFFF }, \
564 { Color88 , 0x870000 }, \
565 { Color89 , 0x87005F }, \
566 { Color90 , 0x870087 }, \
567 { Color91 , 0x8700AF }, \
568 { Color92 , 0x8700D7 }, \
569 { Color93 , 0x8700FF }, \
570 { Color94 , 0x875F00 }, \
571 { Color95 , 0x875F5F }, \
572 { Color96 , 0x875F87 }, \
573 { Color97 , 0x875FAF }, \
574 { Color98 , 0x875FD7 }, \
575 { Color99 , 0x875FFF }, \
576 { Color100 , 0x878700 }, \
577 { Color101 , 0x87875F }, \
578 { Color102 , 0x878787 }, \
579 { Color103 , 0x8787AF }, \
580 { Color104 , 0x8787D7 }, \
581 { Color105 , 0x8787FF }, \
582 { Color106 , 0x87AF00 }, \
583 { Color107 , 0x87AF5F }, \
584 { Color108 , 0x87AF87 }, \
585 { Color109 , 0x87AFAF }, \
586 { Color110 , 0x87AFD7 }, \
587 { Color111 , 0x87AFFF }, \
588 { Color112 , 0x87D700 }, \
589 { Color113 , 0x87D75F }, \
590 { Color114 , 0x87D787 }, \
591 { Color115 , 0x87D7AF }, \
592 { Color116 , 0x87D7D7 }, \
593 { Color117 , 0x87D7FF }, \
594 { Color118 , 0x87FF00 }, \
595 { Color119 , 0x87FF5F }, \
596 { Color120 , 0x87FF87 }, \
597 { Color121 , 0x87FFAF }, \
598 { Color122 , 0x87FFD7 }, \
599 { Color123 , 0x87FFFF }, \
600 { Color124 , 0xAF0000 }, \
601 { Color125 , 0xAF005F }, \
602 { Color126 , 0xAF0087 }, \
603 { Color127 , 0xAF00AF }, \
604 { Color128 , 0xAF00D7 }, \
605 { Color129 , 0xAF00FF }, \
606 { Color130 , 0xAF5F00 }, \
607 { Color131 , 0xAF5F5F }, \
608 { Color132 , 0xAF5F87 }, \
609 { Color133 , 0xAF5FAF }, \
610 { Color134 , 0xAF5FD7 }, \
611 { Color135 , 0xAF5FFF }, \
612 { Color136 , 0xAF8700 }, \
613 { Color137 , 0xAF875F }, \
614 { Color138 , 0xAF8787 }, \
615 { Color139 , 0xAF87AF }, \
616 { Color140 , 0xAF87D7 }, \
617 { Color141 , 0xAF87FF }, \
618 { Color142 , 0xAFAF00 }, \
619 { Color143 , 0xAFAF5F }, \
620 { Color144 , 0xAFAF87 }, \
621 { Color145 , 0xAFAFAF }, \
622 { Color146 , 0xAFAFD7 }, \
623 { Color147 , 0xAFAFFF }, \
624 { Color148 , 0xAFD700 }, \
625 { Color149 , 0xAFD75F }, \
626 { Color150 , 0xAFD787 }, \
627 { Color151 , 0xAFD7AF }, \
628 { Color152 , 0xAFD7D7 }, \
629 { Color153 , 0xAFD7FF }, \
630 { Color154 , 0xAFFF00 }, \
631 { Color155 , 0xAFFF5F }, \
632 { Color156 , 0xAFFF87 }, \
633 { Color157 , 0xAFFFAF }, \
634 { Color158 , 0xAFFFD7 }, \
635 { Color159 , 0xAFFFFF }, \
636 { Color160 , 0xD70000 }, \
637 { Color161 , 0xD7005F }, \
638 { Color162 , 0xD70087 }, \
639 { Color163 , 0xD700AF }, \
640 { Color164 , 0xD700D7 }, \
641 { Color165 , 0xD700FF }, \
642 { Color166 , 0xD75F00 }, \
643 { Color167 , 0xD75F5F }, \
644 { Color168 , 0xD75F87 }, \
645 { Color169 , 0xD75FAF }, \
646 { Color170 , 0xD75FD7 }, \
647 { Color171 , 0xD75FFF }, \
648 { Color172 , 0xD78700 }, \
649 { Color173 , 0xD7875F }, \
650 { Color174 , 0xD78787 }, \
651 { Color175 , 0xD787AF }, \
652 { Color176 , 0xD787D7 }, \
653 { Color177 , 0xD787FF }, \
654 { Color178 , 0xD7AF00 }, \
655 { Color179 , 0xD7AF5F }, \
656 { Color180 , 0xD7AF87 }, \
657 { Color181 , 0xD7AFAF }, \
658 { Color182 , 0xD7AFD7 }, \
659 { Color183 , 0xD7AFFF }, \
660 { Color184 , 0xD7D700 }, \
661 { Color185 , 0xD7D75F }, \
662 { Color186 , 0xD7D787 }, \
663 { Color187 , 0xD7D7AF }, \
664 { Color188 , 0xD7D7D7 }, \
665 { Color189 , 0xD7D7FF }, \
666 { Color190 , 0xD7FF00 }, \
667 { Color191 , 0xD7FF5F }, \
668 { Color192 , 0xD7FF87 }, \
669 { Color193 , 0xD7FFAF }, \
670 { Color194 , 0xD7FFD7 }, \
671 { Color195 , 0xD7FFFF }, \
672 { Color196 , 0xFF0000 }, \
673 { Color197 , 0xFF005F }, \
674 { Color198 , 0xFF0087 }, \
675 { Color199 , 0xFF00AF }, \
676 { Color200 , 0xFF00D7 }, \
677 { Color201 , 0xFF00FF }, \
678 { Color202 , 0xFF5F00 }, \
679 { Color203 , 0xFF5F5F }, \
680 { Color204 , 0xFF5F87 }, \
681 { Color205 , 0xFF5FAF }, \
682 { Color206 , 0xFF5FD7 }, \
683 { Color207 , 0xFF5FFF }, \
684 { Color208 , 0xFF8700 }, \
685 { Color209 , 0xFF875F }, \
686 { Color210 , 0xFF8787 }, \
687 { Color211 , 0xFF87AF }, \
688 { Color212 , 0xFF87D7 }, \
689 { Color213 , 0xFF87FF }, \
690 { Color214 , 0xFFAF00 }, \
691 { Color215 , 0xFFAF5F }, \
692 { Color216 , 0xFFAF87 }, \
693 { Color217 , 0xFFAFAF }, \
694 { Color218 , 0xFFAFD7 }, \
695 { Color219 , 0xFFAFFF }, \
696 { Color220 , 0xFFD700 }, \
697 { Color221 , 0xFFD75F }, \
698 { Color222 , 0xFFD787 }, \
699 { Color223 , 0xFFD7AF }, \
700 { Color224 , 0xFFD7D7 }, \
701 { Color225 , 0xFFD7FF }, \
702 { Color226 , 0xFFFF00 }, \
703 { Color227 , 0xFFFF5F }, \
704 { Color228 , 0xFFFF87 }, \
705 { Color229 , 0xFFFFAF }, \
706 { Color230 , 0xFFFFD7 }, \
707 { Color231 , 0xFFFFFF }, \
708 { Color232 , 0x080808 }, \
709 { Color233 , 0x121212 }, \
710 { Color234 , 0x1C1C1C }, \
711 { Color235 , 0x262626 }, \
712 { Color236 , 0x303030 }, \
713 { Color237 , 0x3A3A3A }, \
714 { Color238 , 0x444444 }, \
715 { Color239 , 0x4E4E4E }, \
716 { Color240 , 0x585858 }, \
717 { Color241 , 0x626262 }, \
718 { Color242 , 0x6C6C6C }, \
719 { Color243 , 0x767676 }, \
720 { Color244 , 0x808080 }, \
721 { Color245 , 0x8A8A8A }, \
722 { Color246 , 0x949494 }, \
723 { Color247 , 0x9E9E9E }, \
724 { Color248 , 0xA8A8A8 }, \
725 { Color249 , 0xB2B2B2 }, \
726 { Color250 , 0xBCBCBC }, \
727 { Color251 , 0xC6C6C6 }, \
728 { Color252 , 0xD0D0D0 }, \
729 { Color253 , 0xDADADA }, \
730 { Color254 , 0xE4E4E4 }, \
731 { Color255 , 0xEEEEEE }, \
732 { ColorAliceBlue , 0xF0F8FF }, \
733 { ColorAntiqueWhite , 0xFAEBD7 }, \
734 { ColorAquaMarine , 0x7FFFD4 }, \
735 { ColorAzure , 0xF0FFFF }, \
736 { ColorBeige , 0xF5F5DC }, \
737 { ColorBisque , 0xFFE4C4 }, \
738 { ColorBlanchedAlmond , 0xFFEBCD }, \
739 { ColorBlueViolet , 0x8A2BE2 }, \
740 { ColorBrown , 0xA52A2A }, \
741 { ColorBurlyWood , 0xDEB887 }, \
742 { ColorCadetBlue , 0x5F9EA0 }, \
743 { ColorChartreuse , 0x7FFF00 }, \
744 { ColorChocolate , 0xD2691E }, \
745 { ColorCoral , 0xFF7F50 }, \
746 { ColorCornflowerBlue , 0x6495ED }, \
747 { ColorCornsilk , 0xFFF8DC }, \
748 { ColorCrimson , 0xDC143C }, \
749 { ColorDarkBlue , 0x00008B }, \
750 { ColorDarkCyan , 0x008B8B }, \
751 { ColorDarkGoldenrod , 0xB8860B }, \
752 { ColorDarkGray , 0xA9A9A9 }, \
753 { ColorDarkGreen , 0x006400 }, \
754 { ColorDarkKhaki , 0xBDB76B }, \
755 { ColorDarkMagenta , 0x8B008B }, \
756 { ColorDarkOliveGreen , 0x556B2F }, \
757 { ColorDarkOrange , 0xFF8C00 }, \
758 { ColorDarkOrchid , 0x9932CC }, \
759 { ColorDarkRed , 0x8B0000 }, \
760 { ColorDarkSalmon , 0xE9967A }, \
761 { ColorDarkSeaGreen , 0x8FBC8F }, \
762 { ColorDarkSlateBlue , 0x483D8B }, \
763 { ColorDarkSlateGray , 0x2F4F4F }, \
764 { ColorDarkTurquoise , 0x00CED1 }, \
765 { ColorDarkViolet , 0x9400D3 }, \
766 { ColorDeepPink , 0xFF1493 }, \
767 { ColorDeepSkyBlue , 0x00BFFF }, \
768 { ColorDimGray , 0x696969 }, \
769 { ColorDodgerBlue , 0x1E90FF }, \
770 { ColorFireBrick , 0xB22222 }, \
771 { ColorFloralWhite , 0xFFFAF0 }, \
772 { ColorForestGreen , 0x228B22 }, \
773 { ColorGainsboro , 0xDCDCDC }, \
774 { ColorGhostWhite , 0xF8F8FF }, \
775 { ColorGold , 0xFFD700 }, \
776 { ColorGoldenrod , 0xDAA520 }, \
777 { ColorGreenYellow , 0xADFF2F }, \
778 { ColorHoneydew , 0xF0FFF0 }, \
779 { ColorHotPink , 0xFF69B4 }, \
780 { ColorIndianRed , 0xCD5C5C }, \
781 { ColorIndigo , 0x4B0082 }, \
782 { ColorIvory , 0xFFFFF0 }, \
783 { ColorKhaki , 0xF0E68C }, \
784 { ColorLavender , 0xE6E6FA }, \
785 { ColorLavenderBlush , 0xFFF0F5 }, \
786 { ColorLawnGreen , 0x7CFC00 }, \
787 { ColorLemonChiffon , 0xFFFACD }, \
788 { ColorLightBlue , 0xADD8E6 }, \
789 { ColorLightCoral , 0xF08080 }, \
790 { ColorLightCyan , 0xE0FFFF }, \
791 { ColorLightGoldenrodYellow , 0xFAFAD2 }, \
792 { ColorLightGray , 0xD3D3D3 }, \
793 { ColorLightGreen , 0x90EE90 }, \
794 { ColorLightPink , 0xFFB6C1 }, \
795 { ColorLightSalmon , 0xFFA07A }, \
796 { ColorLightSeaGreen , 0x20B2AA }, \
797 { ColorLightSkyBlue , 0x87CEFA }, \
798 { ColorLightSlateGray , 0x778899 }, \
799 { ColorLightSteelBlue , 0xB0C4DE }, \
800 { ColorLightYellow , 0xFFFFE0 }, \
801 { ColorLimeGreen , 0x32CD32 }, \
802 { ColorLinen , 0xFAF0E6 }, \
803 { ColorMediumAquamarine , 0x66CDAA }, \
804 { ColorMediumBlue , 0x0000CD }, \
805 { ColorMediumOrchid , 0xBA55D3 }, \
806 { ColorMediumPurple , 0x9370DB }, \
807 { ColorMediumSeaGreen , 0x3CB371 }, \
808 { ColorMediumSlateBlue , 0x7B68EE }, \
809 { ColorMediumSpringGreen , 0x00FA9A }, \
810 { ColorMediumTurquoise , 0x48D1CC }, \
811 { ColorMediumVioletRed , 0xC71585 }, \
812 { ColorMidnightBlue , 0x191970 }, \
813 { ColorMintCream , 0xF5FFFA }, \
814 { ColorMistyRose , 0xFFE4E1 }, \
815 { ColorMoccasin , 0xFFE4B5 }, \
816 { ColorNavajoWhite , 0xFFDEAD }, \
817 { ColorOldLace , 0xFDF5E6 }, \
818 { ColorOliveDrab , 0x6B8E23 }, \
819 { ColorOrange , 0xFFA500 }, \
820 { ColorOrangeRed , 0xFF4500 }, \
821 { ColorOrchid , 0xDA70D6 }, \
822 { ColorPaleGoldenrod , 0xEEE8AA }, \
823 { ColorPaleGreen , 0x98FB98 }, \
824 { ColorPaleTurquoise , 0xAFEEEE }, \
825 { ColorPaleVioletRed , 0xDB7093 }, \
826 { ColorPapayaWhip , 0xFFEFD5 }, \
827 { ColorPeachPuff , 0xFFDAB9 }, \
828 { ColorPeru , 0xCD853F }, \
829 { ColorPink , 0xFFC0CB }, \
830 { ColorPlum , 0xDDA0DD }, \
831 { ColorPowderBlue , 0xB0E0E6 }, \
832 { ColorRebeccaPurple , 0x663399 }, \
833 { ColorRosyBrown , 0xBC8F8F }, \
834 { ColorRoyalBlue , 0x4169E1 }, \
835 { ColorSaddleBrown , 0x8B4513 }, \
836 { ColorSalmon , 0xFA8072 }, \
837 { ColorSandyBrown , 0xF4A460 }, \
838 { ColorSeaGreen , 0x2E8B57 }, \
839 { ColorSeashell , 0xFFF5EE }, \
840 { ColorSienna , 0xA0522D }, \
841 { ColorSkyblue , 0x87CEEB }, \
842 { ColorSlateBlue , 0x6A5ACD }, \
843 { ColorSlateGray , 0x708090 }, \
844 { ColorSnow , 0xFFFAFA }, \
845 { ColorSpringGreen , 0x00FF7F }, \
846 { ColorSteelBlue , 0x4682B4 }, \
847 { ColorTan , 0xD2B48C }, \
848 { ColorThistle , 0xD8BFD8 }, \
849 { ColorTomato , 0xFF6347 }, \
850 { ColorTurquoise , 0x40E0D0 }, \
851 { ColorViolet , 0xEE82EE }, \
852 { ColorWheat , 0xF5DEB3 }, \
853 { ColorWhiteSmoke , 0xF5F5F5 }, \
854 { ColorYellowGreen , 0x9ACD32 }, \
865 #define RGB_COLOR_NAMES { \
866 { "default" , ColorDefault }, \
867 { "black" , ColorBlack }, \
868 { "maroon" , ColorMaroon }, \
869 { "green" , ColorGreen }, \
870 { "olive" , ColorOlive }, \
871 { "navy" , ColorNavy }, \
872 { "purple" , ColorPurple }, \
873 { "teal" , ColorTeal }, \
874 { "silver" , ColorSilver }, \
875 { "gray" , ColorGray }, \
876 { "red" , ColorRed }, \
877 { "lime" , ColorLime }, \
878 { "yellow" , ColorYellow }, \
879 { "blue" , ColorBlue }, \
880 { "fuchsia" , ColorFuchsia }, \
881 { "aqua" , ColorAqua }, \
882 { "white" , ColorWhite }, \
883 { "aliceblue" , ColorAliceBlue }, \
884 { "antiquewhite" , ColorAntiqueWhite }, \
885 { "aquamarine" , ColorAquaMarine }, \
886 { "azure" , ColorAzure }, \
887 { "beige" , ColorBeige }, \
888 { "bisque" , ColorBisque }, \
889 { "blanchedalmond" , ColorBlanchedAlmond }, \
890 { "blueviolet" , ColorBlueViolet }, \
891 { "brown" , ColorBrown }, \
892 { "burlywood" , ColorBurlyWood }, \
893 { "cadetblue" , ColorCadetBlue }, \
894 { "chartreuse" , ColorChartreuse }, \
895 { "chocolate" , ColorChocolate }, \
896 { "coral" , ColorCoral }, \
897 { "cornflowerblue" , ColorCornflowerBlue }, \
898 { "cornsilk" , ColorCornsilk }, \
899 { "crimson" , ColorCrimson }, \
900 { "darkblue" , ColorDarkBlue }, \
901 { "darkcyan" , ColorDarkCyan }, \
902 { "darkgoldenrod" , ColorDarkGoldenrod }, \
903 { "darkgray" , ColorDarkGray }, \
904 { "darkgreen" , ColorDarkGreen }, \
905 { "darkkhaki" , ColorDarkKhaki }, \
906 { "darkmagenta" , ColorDarkMagenta }, \
907 { "darkolivegreen" , ColorDarkOliveGreen }, \
908 { "darkorange" , ColorDarkOrange }, \
909 { "darkorchid" , ColorDarkOrchid }, \
910 { "darkred" , ColorDarkRed }, \
911 { "darksalmon" , ColorDarkSalmon }, \
912 { "darkseagreen" , ColorDarkSeaGreen }, \
913 { "darkslateblue" , ColorDarkSlateBlue }, \
914 { "darkslategray" , ColorDarkSlateGray }, \
915 { "darkturquoise" , ColorDarkTurquoise }, \
916 { "darkviolet" , ColorDarkViolet }, \
917 { "deeppink" , ColorDeepPink }, \
918 { "deepskyblue" , ColorDeepSkyBlue }, \
919 { "dimgray" , ColorDimGray }, \
920 { "dodgerblue" , ColorDodgerBlue }, \
921 { "firebrick" , ColorFireBrick }, \
922 { "floralwhite" , ColorFloralWhite }, \
923 { "forestgreen" , ColorForestGreen }, \
924 { "gainsboro" , ColorGainsboro }, \
925 { "ghostwhite" , ColorGhostWhite }, \
926 { "gold" , ColorGold }, \
927 { "goldenrod" , ColorGoldenrod }, \
928 { "greenyellow" , ColorGreenYellow }, \
929 { "honeydew" , ColorHoneydew }, \
930 { "hotpink" , ColorHotPink }, \
931 { "indianred" , ColorIndianRed }, \
932 { "indigo" , ColorIndigo }, \
933 { "ivory" , ColorIvory }, \
934 { "khaki" , ColorKhaki }, \
935 { "lavender" , ColorLavender }, \
936 { "lavenderblush" , ColorLavenderBlush }, \
937 { "lawngreen" , ColorLawnGreen }, \
938 { "lemonchiffon" , ColorLemonChiffon }, \
939 { "lightblue" , ColorLightBlue }, \
940 { "lightcoral" , ColorLightCoral }, \
941 { "lightcyan" , ColorLightCyan }, \
942 { "lightgoldenrodyellow" , ColorLightGoldenrodYellow }, \
943 { "lightgray" , ColorLightGray }, \
944 { "lightgreen" , ColorLightGreen }, \
945 { "lightpink" , ColorLightPink }, \
946 { "lightsalmon" , ColorLightSalmon }, \
947 { "lightseagreen" , ColorLightSeaGreen }, \
948 { "lightskyblue" , ColorLightSkyBlue }, \
949 { "lightslategray" , ColorLightSlateGray }, \
950 { "lightsteelblue" , ColorLightSteelBlue }, \
951 { "lightyellow" , ColorLightYellow }, \
952 { "limegreen" , ColorLimeGreen }, \
953 { "linen" , ColorLinen }, \
954 { "mediumaquamarine" , ColorMediumAquamarine }, \
955 { "mediumblue" , ColorMediumBlue }, \
956 { "mediumorchid" , ColorMediumOrchid }, \
957 { "mediumpurple" , ColorMediumPurple }, \
958 { "mediumseagreen" , ColorMediumSeaGreen }, \
959 { "mediumslateblue" , ColorMediumSlateBlue }, \
960 { "mediumspringgreen" , ColorMediumSpringGreen }, \
961 { "mediumturquoise" , ColorMediumTurquoise }, \
962 { "mediumvioletred" , ColorMediumVioletRed }, \
963 { "midnightblue" , ColorMidnightBlue }, \
964 { "mintcream" , ColorMintCream }, \
965 { "mistyrose" , ColorMistyRose }, \
966 { "moccasin" , ColorMoccasin }, \
967 { "navajowhite" , ColorNavajoWhite }, \
968 { "oldlace" , ColorOldLace }, \
969 { "olivedrab" , ColorOliveDrab }, \
970 { "orange" , ColorOrange }, \
971 { "orangered" , ColorOrangeRed }, \
972 { "orchid" , ColorOrchid }, \
973 { "palegoldenrod" , ColorPaleGoldenrod }, \
974 { "palegreen" , ColorPaleGreen }, \
975 { "paleturquoise" , ColorPaleTurquoise }, \
976 { "palevioletred" , ColorPaleVioletRed }, \
977 { "papayawhip" , ColorPapayaWhip }, \
978 { "peachpuff" , ColorPeachPuff }, \
979 { "peru" , ColorPeru }, \
980 { "pink" , ColorPink }, \
981 { "plum" , ColorPlum }, \
982 { "powderblue" , ColorPowderBlue }, \
983 { "rebeccapurple" , ColorRebeccaPurple }, \
984 { "rosybrown" , ColorRosyBrown }, \
985 { "royalblue" , ColorRoyalBlue }, \
986 { "saddlebrown" , ColorSaddleBrown }, \
987 { "salmon" , ColorSalmon }, \
988 { "sandybrown" , ColorSandyBrown }, \
989 { "seagreen" , ColorSeaGreen }, \
990 { "seashell" , ColorSeashell }, \
991 { "sienna" , ColorSienna }, \
992 { "skyblue" , ColorSkyblue }, \
993 { "slateblue" , ColorSlateBlue }, \
994 { "slategray" , ColorSlateGray }, \
995 { "snow" , ColorSnow }, \
996 { "springgreen" , ColorSpringGreen }, \
997 { "steelblue" , ColorSteelBlue }, \
998 { "tan" , ColorTan }, \
999 { "thistle" , ColorThistle }, \
1000 { "tomato" , ColorTomato }, \
1001 { "turquoise" , ColorTurquoise }, \
1002 { "violet" , ColorViolet }, \
1003 { "wheat" , ColorWheat }, \
1004 { "whitesmoke" , ColorWhiteSmoke }, \
1005 { "yellowgreen" , ColorYellowGreen }, \
1006 { "grey" , ColorGray }, \
1007 { "dimgrey" , ColorDimGray }, \
1008 { "darkgrey" , ColorDarkGray }, \
1009 { "darkslategrey" , ColorDarkSlateGray }, \
1010 { "lightgrey" , ColorLightGray }, \
1011 { "lightslategrey" , ColorLightSlateGray }, \
1012 { "slategrey" , ColorSlateGray }, \
1013 { "magenta" , ColorFuchsia}, \
1014 { "cyan" , ColorAqua}, \
1031 VT_DEFAULT_FONT = 10,
1032 VT_UNDERLINE_OFF = 24,
1034 VT_INVERSE_OFF = 27,
1036 VT_NOT_CROSSED_OUT = 29,
1042 VT_NOT_OVERLINED = 55,
1044 VT_UNKNOWN_ATTR = 99
1053 #define VT_ATTRS { \
1054 { "off", VT_OFF }, \
1055 { "bold", VT_BOLD }, \
1056 { "faint", VT_FAINT }, \
1057 { "italic", VT_ITALIC }, \
1058 { "underscore", VT_UNDERSCORE }, \
1059 { "blink", VT_SLOW_BLINK }, \
1060 { "fastblink", VT_FAST_BLINK }, \
1061 { "reverse", VT_REVERSE }, \
1062 { "concealed", VT_CONCEALED }, \
1063 { "crossout", VT_CROSSOUT }, \
1064 { "deffont", VT_DEFAULT_FONT }, \
1065 { "default", VT_NO_ATTR }, \
1066 { NULL, VT_UNKNOWN_ATTR } \
1070 #define VT_BLINK VT_SLOW_BLINK
1075 #define vt100_cursor_off ESC "[?25l"
1076 #define vt100_cursor_on ESC "[?25h"
1077 #define vt100_save_cursor ESC "7"
1078 #define vt100_restore_cursor ESC "8"
1079 #define vt100_line_feed ESC "D"
1080 #define vt100_crnl ESC "E"
1081 #define vt100_reverse_line_feed ESC "M"
1082 #define vt100_up_arr ESC "[A"
1083 #define vt100_down_arr ESC "[B"
1084 #define vt100_right_arr ESC "[C"
1085 #define vt100_left_arr ESC "[D"
1086 #define vt100_up_lines ESC "[%dA"
1087 #define vt100_down_lines ESC "[%dB"
1088 #define vt100_right_columns ESC "[%dC"
1089 #define vt100_left_columns ESC "[%dD"
1090 #define vt100_move_down_nlines ESC "[%dE"
1091 #define vt100_scroll_down ESC "[%dT"
1092 #define vt100_scroll_up ESC "[%dS"
1093 #define vt100_home ESC "[H"
1094 #define vt100_pos ESC "[%d;%dH"
1095 #define vt100_setw ESC "[%d;r"
1096 #define vt100_clear_right ESC "[0K"
1097 #define vt100_clear_left ESC "[1K"
1098 #define vt100_clear_down ESC "[0J"
1099 #define vt100_clear_up ESC "[1J"
1100 #define vt100_clear_line ESC "[2K"
1101 #define vt100_clear_screen ESC "[2J"
1102 #define vt100_pos_cursor ESC "[%d;%dH"
1103 #define vt100_multi_right ESC "\133%uC"
1104 #define vt100_multi_left ESC "\133%uD"
1105 #define vt100_cursor_pos ESC "[6n"
1106 #define vt100_clr_eol ESC "[K"
1107 #define vt100_clr_eos ESC "[J"
1110 #define _s(_x, _y) static __inline__ void _x { _y; }
1167 _s(vt_scroll_up(
int r),
tty_printf(vt100_scroll_up, r))
1208 static __inline__
void
1209 vt_make_space(
int n)
1211 for (
int i = 0; i < (n + 1); i++)
1222 static __inline__
void
1237 static __inline__
void
1254 static __inline__
int
1259 s = ((ncols / 2) - (strlen(msg) / 2));
1260 return (s <= 0) ? 1 : s;
1270 static __inline__
void
1274 vt_pos(nrows + 1, 1);
1275 for(
int i = 0; i < (nrows + 3); i += 4)
1291 static __inline__
void
1297 for (i = 0; i < cnt; i++)
1313 static __inline__
void
1318 for (i = 0; i < cnt; i++) {
1332 static __inline__
void
1346 static __inline__
void
1362 static __inline__
void
1365 tty_printf(ESC
"[%d;%d;%dm", attr, fg + 30, bg + 40);
1378 static __inline__
void
1382 if ((fg != VT_NO_CHANGE) && (bg != VT_NO_CHANGE))
1384 else if (fg == VT_NO_CHANGE)
1386 else if (bg == VT_NO_CHANGE)
1402 static __inline__
void
1405 tty_printf(ESC
"[%d:2:%d:%d:%dm", fg_bg, r, g, b);
1422 static __inline__
int
1425 return snprintf(str, len, ESC
"[%d;%dm", attr, color + 30);
1442 static __inline__
int
1445 return snprintf(str, len, ESC
"[%d;%dm", attr, color + 40);
1460 static __inline__
int
1463 return snprintf(str, len, ESC
"[%dm", attr);
1482 static __inline__
int
1485 return snprintf(str, len, ESC
"[%d;%d;%dm", attr, fg + 30, bg + 40);
1505 static __inline__
int
1508 if ((fg != VT_NO_CHANGE) && (bg != VT_NO_CHANGE))
1510 else if (fg == VT_NO_CHANGE)
1512 else if (bg == VT_NO_CHANGE)
1536 static __inline__
int
1539 return snprintf(str, len, ESC
"[%d:2::%d:%d:%dm", fg_bg, r, g, b);
CNDP_API int tty_write(const char *buf, int len)
static __inline__ int vt_fgcolor_str(char *str, int len, vt_color_e color, vt_attr_e attr)
CNDP_API int vt_color_parse(char *buff, int len)
static __inline__ int vt_fgbgcolor_str(char *str, int len, vt_color_e fg, vt_color_e bg, vt_attr_e attr)
_s(vt_pos(int r, int c), tty_printf(vt100_pos, r, c)) _s(vt_top(void)
static __inline__ void vt_fgbgcolor(vt_color_e fg, vt_color_e bg, vt_attr_e attr)
static __inline__ void vt_clr_line(int r)
static __inline__ void vt_eol_pos(int r, int c)
static __inline__ void vt_rgb(uint8_t fg_bg, vt_rgb_t r, vt_rgb_t g, vt_rgb_t b)
tty_printf(vt100_home)) _s(vt_home(void)
static __inline__ void vt_repeat(int16_t r, int16_t c, const char *str, int cnt)
static __inline__ void vt_col_repeat(int16_t r, int16_t c, const char *str, int cnt)
static __inline__ void vt_fgcolor(vt_color_e color, vt_attr_e attr)
static __inline__ int vt_bgcolor_str(char *str, int len, vt_color_e color, vt_attr_e attr)
static __inline__ int vt_rgb_str(char *str, int len, uint8_t fg_bg, vt_rgb_t r, vt_rgb_t g, vt_rgb_t b)
static __inline__ int vt_attr_str(char *str, int len, vt_attr_e attr)
static __inline__ int vt_color_str(char *str, int len, vt_color_e fg, vt_color_e bg, vt_attr_e attr)
static __inline__ void vt_bgcolor(vt_color_e color, vt_attr_e attr)
static __inline__ int vt_center_col(int16_t ncols, const char *msg)
static __inline__ void vt_erase(int16_t nrows)
static __inline__ void vt_color(vt_color_e fg, vt_color_e bg, vt_attr_e attr)