… | |
… | |
694 | #ifndef NO_CURSORCOLOR |
694 | #ifndef NO_CURSORCOLOR |
695 | case Color_cursor2: |
695 | case Color_cursor2: |
696 | #endif |
696 | #endif |
697 | case Color_pointer_fg: |
697 | case Color_pointer_fg: |
698 | name = rs[Rs_color + Color_fg]; |
698 | name = rs[Rs_color + Color_fg]; |
699 | xcol = pix_colors[Color_fg]; |
699 | xcol.set (this, name); |
700 | break; |
700 | break; |
701 | default: |
701 | default: |
702 | name = rs[Rs_color + Color_bg]; |
702 | name = rs[Rs_color + Color_bg]; |
703 | xcol = pix_colors[Color_bg]; |
703 | xcol.set (this, name); |
704 | break; |
704 | break; |
705 | } |
705 | } |
706 | } |
706 | } |
707 | } |
707 | } |
708 | |
708 | |
709 | pix_colors[i] = xcol; |
709 | pix_colors[i] = xcol; |
710 | rs[Rs_color + i] = name; |
710 | rs[Rs_color + i] = name; |
711 | } |
711 | } |
712 | |
712 | |
713 | #ifdef OFF_FOCUS_FADING |
|
|
714 | if (rs[Rs_fade]) |
|
|
715 | for (i = 0; i < (depth <= 2 ? 2 : NRS_COLORS); i++) |
|
|
716 | { |
|
|
717 | rgba c; |
|
|
718 | pix_colors[Color_fade].get (c); |
|
|
719 | pix_colors_focused[i].fade (this, atoi (rs[Rs_fade]), pix_colors_unfocused[i],c); |
|
|
720 | } |
|
|
721 | #endif |
|
|
722 | |
|
|
723 | if (depth <= 2) |
713 | if (depth <= 2) |
724 | { |
714 | { |
725 | if (!rs[Rs_color + Color_pointer_fg]) pix_colors[Color_pointer_fg] = pix_colors[Color_fg]; |
715 | if (!rs[Rs_color + Color_pointer_fg]) alias_color (Color_pointer_fg, Color_fg); |
726 | if (!rs[Rs_color + Color_pointer_bg]) pix_colors[Color_pointer_bg] = pix_colors[Color_bg]; |
716 | if (!rs[Rs_color + Color_pointer_bg]) alias_color (Color_pointer_bg, Color_bg); |
727 | if (!rs[Rs_color + Color_border] ) pix_colors[Color_border] = pix_colors[Color_fg]; |
717 | if (!rs[Rs_color + Color_border] ) alias_color (Color_border, Color_fg); |
728 | } |
718 | } |
729 | |
719 | |
730 | /* |
720 | /* |
731 | * get scrollBar shadow colors |
721 | * get scrollBar shadow colors |
732 | * |
722 | * |
733 | * The calculations of topShadow/bottomShadow values are adapted |
723 | * The calculations of topShadow/bottomShadow values are adapted |
734 | * from the fvwm window manager. |
724 | * from the fvwm window manager. |
735 | */ |
725 | */ |
736 | #ifdef KEEP_SCROLLCOLOR |
726 | #ifdef KEEP_SCROLLCOLOR |
737 | |
|
|
738 | if (depth <= 2) |
727 | if (depth <= 2) |
739 | { |
728 | { |
740 | /* Monochrome */ |
729 | /* Monochrome */ |
741 | pix_colors[Color_scroll] = pix_colors[Color_fg]; |
730 | alias_color (Color_scroll, Color_fg); |
742 | pix_colors[Color_topShadow] = pix_colors[Color_bg]; |
731 | alias_color (Color_topShadow, Color_bg); |
743 | pix_colors[Color_bottomShadow] = pix_colors[Color_bg]; |
732 | alias_color (Color_bottomShadow, Color_bg); |
744 | } |
733 | } |
745 | else |
734 | else |
746 | { |
735 | { |
747 | rxvt_color xcol[2]; |
736 | pix_colors [Color_scroll].fade (this, 50, pix_colors [Color_bottomShadow]); |
748 | /* xcol[0] == white |
|
|
749 | * xcol[1] == top shadow |
|
|
750 | * xcol[2] == bot shadow */ |
|
|
751 | |
737 | |
752 | xcol[1] = pix_colors[Color_scroll]; |
|
|
753 | xcol[0].set (this, rgba (rgba::MAX_CC, rgba::MAX_CC, rgba::MAX_CC)); |
|
|
754 | |
|
|
755 | rgba c0, c1; |
738 | rgba cscroll; |
756 | |
739 | pix_colors [Color_scroll].get (cscroll); |
757 | xcol[0].get (c0); |
|
|
758 | xcol[1].get (c1); |
|
|
759 | |
|
|
760 | xcol[1].fade (this, 50, pix_colors[Color_bottomShadow]); |
|
|
761 | |
740 | |
762 | /* topShadowColor */ |
741 | /* topShadowColor */ |
763 | if (!xcol[1].set (this, |
742 | if (!pix_colors[Color_topShadow].set (this, |
764 | rgba ( |
743 | rgba ( |
765 | min (c0.r, max (c1.r / 5, c1.r) * 7 / 5), |
744 | min ((int)rgba::MAX_CC, max (cscroll.r / 5, cscroll.r) * 7 / 5), |
766 | min (c0.g, max (c1.g / 5, c1.g) * 7 / 5), |
745 | min ((int)rgba::MAX_CC, max (cscroll.g / 5, cscroll.g) * 7 / 5), |
767 | min (c0.b, max (c1.b / 5, c1.b) * 7 / 5), |
746 | min ((int)rgba::MAX_CC, max (cscroll.b / 5, cscroll.b) * 7 / 5), |
768 | c1.a) // pa1 vs. pa0: arbitrary |
747 | cscroll.a) |
769 | )); |
748 | )) |
770 | xcol[1] = pix_colors[Color_White]; |
749 | alias_color (Color_topShadow, Color_White); |
771 | |
|
|
772 | pix_colors[Color_topShadow] = xcol[1]; |
|
|
773 | } |
750 | } |
774 | #endif /* KEEP_SCROLLCOLOR */ |
751 | #endif /* KEEP_SCROLLCOLOR */ |
|
|
752 | |
|
|
753 | #ifdef OFF_FOCUS_FADING |
|
|
754 | if (rs[Rs_fade]) |
|
|
755 | for (i = 0; i < (depth <= 2 ? 2 : NRS_COLORS); i++) |
|
|
756 | { |
|
|
757 | rgba c; |
|
|
758 | pix_colors [Color_fade].get (c); |
|
|
759 | pix_colors_focused [i].fade (this, atoi (rs[Rs_fade]), pix_colors_unfocused[i],c); |
|
|
760 | } |
|
|
761 | #endif |
775 | } |
762 | } |
776 | |
763 | |
777 | /*----------------------------------------------------------------------*/ |
764 | /*----------------------------------------------------------------------*/ |
778 | /* color aliases, fg/bg bright-bold */ |
765 | /* color aliases, fg/bg bright-bold */ |
779 | void |
766 | void |