Skip to content

Commit

Permalink
Update helix-tui/src/buffer.rs
Browse files Browse the repository at this point in the history
Co-authored-by: yvt <[email protected]>
  • Loading branch information
farwyler and yvt committed Jun 23, 2022
1 parent 5d1d634 commit df08279
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions helix-tui/src/buffer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -585,9 +585,9 @@ impl Buffer {

/// Apply shade to all cells in area.
///
/// shade = 0 -> set text modifier DIM
/// shade < 0 -> darken rgb color
/// shade > 0 -> lighten rgb color
/// - `shade = 0`: set text modifier `DIM`
/// - `shade < 0`: darken rgb color
/// - `shade > 0`: lighten rgb color
pub fn dim(&mut self, area: Rect, shade: i8) {
let alpha = i32::from(shade).unsigned_abs() << 1;
let (src_factor, dst_factor) = (alpha, 256 - alpha);
Expand Down

0 comments on commit df08279

Please sign in to comment.