@@ -7,7 +7,7 @@ use std::{
7
7
} ;
8
8
use unicode_segmentation:: UnicodeSegmentation ;
9
9
10
- use crate :: { Attrs , AttrsList , FontSystem , LayoutGlyph , LayoutLine , ShapeLine } ;
10
+ use crate :: { Attrs , AttrsList , Color , FontSystem , LayoutGlyph , LayoutLine , ShapeLine } ;
11
11
12
12
/// An action to perform on a [TextBuffer]
13
13
#[ derive( Clone , Copy , Debug , Eq , PartialEq ) ]
@@ -963,8 +963,8 @@ impl<'a> TextBuffer<'a> {
963
963
964
964
/// Draw the buffer
965
965
#[ cfg( feature = "swash" ) ]
966
- pub fn draw < F > ( & self , cache : & mut crate :: SwashCache , color : u32 , mut f : F )
967
- where F : FnMut ( i32 , i32 , u32 , u32 , u32 )
966
+ pub fn draw < F > ( & self , cache : & mut crate :: SwashCache , color : Color , mut f : F )
967
+ where F : FnMut ( i32 , i32 , u32 , u32 , Color )
968
968
{
969
969
let font_size = self . metrics . font_size ;
970
970
let line_height = self . metrics . line_height ;
@@ -1054,7 +1054,7 @@ impl<'a> TextBuffer<'a> {
1054
1054
line_y - font_size,
1055
1055
cmp:: max ( 0 , max - min) as u32 ,
1056
1056
line_height as u32 ,
1057
- 0x33_00_00_00 | ( color & 0xFF_FF_FF )
1057
+ Color :: rgba ( color. r ( ) , color . g ( ) , color . b ( ) , 0x33 )
1058
1058
) ;
1059
1059
}
1060
1060
c_x += c_w;
@@ -1080,7 +1080,7 @@ impl<'a> TextBuffer<'a> {
1080
1080
line_y - font_size,
1081
1081
cmp:: max ( 0 , max - min) as u32 ,
1082
1082
line_height as u32 ,
1083
- 0x33_00_00_00 | ( color & 0xFF_FF_FF )
1083
+ Color :: rgba ( color. r ( ) , color . g ( ) , color . b ( ) , 0x33 )
1084
1084
) ;
1085
1085
}
1086
1086
}
@@ -1126,7 +1126,7 @@ impl<'a> TextBuffer<'a> {
1126
1126
let ( cache_key, x_int, y_int) = ( glyph. cache_key , glyph. x_int , glyph. y_int ) ;
1127
1127
1128
1128
let glyph_color = match glyph. color_opt {
1129
- Some ( some) => some. 0 ,
1129
+ Some ( some) => some,
1130
1130
None => color,
1131
1131
} ;
1132
1132
0 commit comments