… | |
… | |
637 | char eos; |
637 | char eos; |
638 | int skip; |
638 | int skip; |
639 | |
639 | |
640 | if (1 <= sscanf (name, "[%hd]%n", &c.a, &skip)) |
640 | if (1 <= sscanf (name, "[%hd]%n", &c.a, &skip)) |
641 | { |
641 | { |
642 | printf ("X %d\n", c.a); |
|
|
643 | c.a = lerp<int, int, int> (0, rgba::MAX_CC, c.a); |
642 | c.a = lerp<int, int, int> (0, rgba::MAX_CC, c.a); |
644 | name += skip; |
643 | name += skip; |
645 | printf ("y %04x\n", c.a); |
|
|
646 | } |
644 | } |
647 | else |
645 | else |
648 | c.a = rgba::MAX_CC; |
646 | c.a = rgba::MAX_CC; |
649 | |
647 | |
650 | // parse the non-standard rgba format |
648 | // parse the non-standard rgba format |
… | |
… | |
719 | |
717 | |
720 | return got; |
718 | return got; |
721 | } |
719 | } |
722 | |
720 | |
723 | void |
721 | void |
724 | rxvt_color::get (rxvt_screen *screen, rgba &color) |
722 | rxvt_color::get (rgba &color) |
725 | { |
723 | { |
726 | #if XFT |
724 | #if XFT |
727 | color.r = c.color.red; |
725 | color.r = c.color.red; |
728 | color.g = c.color.green; |
726 | color.g = c.color.green; |
729 | color.b = c.color.blue; |
727 | color.b = c.color.blue; |
… | |
… | |
748 | |
746 | |
749 | void |
747 | void |
750 | rxvt_color::fade (rxvt_screen *screen, int percent, rxvt_color &result, const rgba &to) |
748 | rxvt_color::fade (rxvt_screen *screen, int percent, rxvt_color &result, const rgba &to) |
751 | { |
749 | { |
752 | rgba c; |
750 | rgba c; |
753 | get (screen, c); |
751 | get (c); |
754 | |
752 | |
755 | result.set ( |
753 | result.set ( |
756 | screen, |
754 | screen, |
757 | rgba ( |
755 | rgba ( |
758 | lerp (c.r, to.r, percent), |
756 | lerp (c.r, to.r, percent), |