SHARE
TWEET

Untitled

a guest Oct 21st, 2019 90 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. pixel |=
  3.     (color.red as u32) >> (8 - self.screen_info.red.length) << self.screen_info.red.offset;
  4. pixel |= (color.green as u32) >> (8 - self.screen_info.green.length)
  5.     << self.screen_info.green.offset;
  6. pixel |= (color.blue as u32) >> (8 - self.screen_info.blue.length)
  7.     << self.screen_info.blue.offset;
  8. pixel |= (color.alpha as u32) >> (8 - self.screen_info.transp.length)
  9.     << self.screen_info.transp.offset;
  10.  
  11.  
  12. let new_color = Some(Color {
  13.     red: (color.red as f32 * opacity + prev_color.red as f32 * rev_opacity)
  14.         as u8,
  15.     green: (color.green as f32 * opacity
  16.         + prev_color.green as f32 * rev_opacity)
  17.         as u8,
  18.     blue: (color.blue as f32 * opacity
  19.         + prev_color.blue as f32 * rev_opacity)
  20.         as u8,
  21.     alpha: 255,
  22. });
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top