… | |
… | |
655 | pix_colors = pix_colors_focused; |
655 | pix_colors = pix_colors_focused; |
656 | #endif |
656 | #endif |
657 | |
657 | |
658 | for (i = 0; i < (depth <= 2 ? 2 : NRS_COLORS); i++) |
658 | for (i = 0; i < (depth <= 2 ? 2 : NRS_COLORS); i++) |
659 | { |
659 | { |
|
|
660 | const char *name = rs[Rs_color + i]; |
|
|
661 | |
|
|
662 | if (!name) |
|
|
663 | continue; |
|
|
664 | |
660 | rxvt_color xcol; |
665 | rxvt_color xcol; |
661 | |
666 | |
662 | if (!rs[Rs_color + i]) |
|
|
663 | continue; |
|
|
664 | |
|
|
665 | if (!set_color (xcol, rs[Rs_color + i])) |
667 | if (!set_color (xcol, name)) |
666 | { |
668 | { |
667 | #ifndef XTERM_REVERSE_VIDEO |
669 | #ifndef XTERM_REVERSE_VIDEO |
668 | if (i < 2 && OPTION (Opt_reverseVideo)) |
670 | if (i < 2 && OPTION (Opt_reverseVideo)) |
669 | rs[Rs_color + i] = def_colorName[!i]; |
671 | name = def_colorName [1 - i]; |
670 | else |
672 | else |
671 | #endif |
673 | #endif |
672 | rs[Rs_color + i] = def_colorName[i]; |
674 | name = def_colorName [i]; |
673 | |
675 | |
674 | if (!rs[Rs_color + i]) |
676 | if (!name) |
675 | continue; |
677 | continue; |
676 | |
678 | |
677 | if (!set_color (xcol, rs[Rs_color + i])) |
679 | if (!set_color (xcol, name)) |
678 | { |
680 | { |
679 | switch (i) |
681 | switch (i) |
680 | { |
682 | { |
681 | case Color_fg: |
683 | case Color_fg: |
682 | case Color_bg: |
684 | case Color_bg: |
683 | /* fatal: need bg/fg color */ |
|
|
684 | rxvt_warn ("unable to get foreground/background colour, continuing.\n"); |
685 | rxvt_warn ("unable to get foreground/background colour, continuing.\n"); |
|
|
686 | name = ""; |
685 | break; |
687 | break; |
686 | #ifndef NO_CURSORCOLOR |
688 | #ifndef NO_CURSORCOLOR |
687 | case Color_cursor2: |
689 | case Color_cursor2: |
688 | xcol = pix_colors[Color_fg]; |
690 | #endif |
689 | break; |
|
|
690 | #endif /* ! NO_CURSORCOLOR */ |
|
|
691 | case Color_pointer_fg: |
691 | case Color_pointer_fg: |
|
|
692 | name = rs[Rs_color + Color_fg]; |
692 | xcol = pix_colors[Color_fg]; |
693 | xcol = pix_colors[Color_fg]; |
693 | break; |
694 | break; |
694 | default: |
695 | default: |
|
|
696 | name = rs[Rs_color + Color_bg]; |
695 | xcol = pix_colors[Color_bg]; /* None */ |
697 | xcol = pix_colors[Color_bg]; |
696 | break; |
698 | break; |
697 | } |
699 | } |
698 | } |
700 | } |
699 | } |
701 | } |
700 | |
702 | |
701 | pix_colors[i] = xcol; |
703 | pix_colors[i] = xcol; |
702 | SET_PIXCOLOR (i); |
704 | rs[Rs_color + i] = name; |
703 | } |
705 | } |
704 | |
706 | |
705 | #ifdef OFF_FOCUS_FADING |
707 | #ifdef OFF_FOCUS_FADING |
706 | if (rs[Rs_fade]) |
708 | if (rs[Rs_fade]) |
707 | for (i = 0; i < (depth <= 2 ? 2 : NRS_COLORS); i++) |
709 | for (i = 0; i < (depth <= 2 ? 2 : NRS_COLORS); i++) |
708 | { |
710 | { |
709 | rxvt_rgba c; |
711 | rgba c; |
710 | pix_colors[Color_fade].get (this, c); |
712 | pix_colors[Color_fade].get (this, c); |
711 | pix_colors_focused[i].fade (this, atoi (rs[Rs_fade]), pix_colors_unfocused[i],c); |
713 | pix_colors_focused[i].fade (this, atoi (rs[Rs_fade]), pix_colors_unfocused[i],c); |
712 | } |
714 | } |
713 | #endif |
715 | #endif |
714 | |
716 | |
… | |
… | |
740 | /* xcol[0] == white |
742 | /* xcol[0] == white |
741 | * xcol[1] == top shadow |
743 | * xcol[1] == top shadow |
742 | * xcol[2] == bot shadow */ |
744 | * xcol[2] == bot shadow */ |
743 | |
745 | |
744 | xcol[1] = pix_colors[Color_scroll]; |
746 | xcol[1] = pix_colors[Color_scroll]; |
745 | xcol[0].set (this, rxvt_rgba (rxvt_rgba::MAX_CC, rxvt_rgba::MAX_CC, rxvt_rgba::MAX_CC)); |
747 | xcol[0].set (this, rgba (rgba::MAX_CC, rgba::MAX_CC, rgba::MAX_CC)); |
746 | |
748 | |
747 | rxvt_rgba c0, c1; |
749 | rgba c0, c1; |
748 | |
750 | |
749 | xcol[0].get (this, c0); |
751 | xcol[0].get (this, c0); |
750 | xcol[1].get (this, c1); |
752 | xcol[1].get (this, c1); |
751 | |
753 | |
752 | xcol[1].fade (this, 50, pix_colors[Color_bottomShadow]); |
754 | xcol[1].fade (this, 50, pix_colors[Color_bottomShadow]); |
753 | |
755 | |
754 | /* topShadowColor */ |
756 | /* topShadowColor */ |
755 | if (!xcol[1].set (this, |
757 | if (!xcol[1].set (this, |
756 | rxvt_rgba ( |
758 | rgba ( |
757 | min (c0.r, max (c1.r / 5, c1.r) * 7 / 5), |
759 | min (c0.r, max (c1.r / 5, c1.r) * 7 / 5), |
758 | min (c0.g, max (c1.g / 5, c1.g) * 7 / 5), |
760 | min (c0.g, max (c1.g / 5, c1.g) * 7 / 5), |
759 | min (c0.b, max (c1.b / 5, c1.b) * 7 / 5), |
761 | min (c0.b, max (c1.b / 5, c1.b) * 7 / 5), |
760 | c1.a) // pa1 vs. pa0: arbitrary |
762 | c1.a) // pa1 vs. pa0: arbitrary |
761 | )); |
763 | )); |