From 00fc22a461b838dd3de057e7b86ee84d7aceb575 Mon Sep 17 00:00:00 2001 From: Marshall Bowers Date: Mon, 8 Jan 2024 13:33:41 -0500 Subject: [PATCH] terminal: Clean up doc comment for `rgb_for_index` (#3947) This PR cleans up the doc comment for the `rgb_for_index` function. Release Notes: - N/A --- crates/terminal/src/terminal.rs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/crates/terminal/src/terminal.rs b/crates/terminal/src/terminal.rs index e1605eb4fb..fa8112bac7 100644 --- a/crates/terminal/src/terminal.rs +++ b/crates/terminal/src/terminal.rs @@ -1459,14 +1459,16 @@ pub fn get_color_at_index(index: usize, theme: &Theme) -> Hsla { } } -///Generates the rgb channels in [0, 5] for a given index into the 6x6x6 ANSI color cube -///See: [8 bit ansi color](https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit). +/// Generates the RGB channels in [0, 5] for a given index into the 6x6x6 ANSI color cube. +/// See: [8 bit ANSI color](https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit). /// -///Wikipedia gives a formula for calculating the index for a given color: +/// Wikipedia gives a formula for calculating the index for a given color: /// -///index = 16 + 36 × r + 6 × g + b (0 ≤ r, g, b ≤ 5) +/// ``` +/// index = 16 + 36 × r + 6 × g + b (0 ≤ r, g, b ≤ 5) +/// ``` /// -///This function does the reverse, calculating the r, g, and b components from a given index. +/// This function does the reverse, calculating the `r`, `g`, and `b` components from a given index. fn rgb_for_index(i: &u8) -> (u8, u8, u8) { debug_assert!((&16..=&231).contains(&i)); let i = i - 16;