pub type RgbTriple = (u8, u8, u8);
pub type GradientTriple = (RgbTriple, RgbTriple, RgbTriple);
#[rustfmt::skip]
pub const PALETTE_MIDNIGHT: &[GradientTriple] = &[
((212,175, 55),(220, 80, 90),(255,230,140)), ((240,120,130),(100,160,220),(255,190,170)), ((100,180,220),(150,210,120),(160,230,210)), ((180, 90,210),(220,160, 60),(220,150,230)), (( 80,180,140),(210, 90,110),(160,230,180)), ((220,130, 70),( 80,180,210),(255,200,120)), ((100,160,230),(200,120,200),(180,200,255)), ((200,100,120),( 80,200,170),(240,160,140)), (( 90,200,180),(210,160, 60),(150,230,220)), ((160,130,210),(120,200,140),(210,180,240)), ((230,180, 80),( 80,150,220),(180,210,240)), ((120,200,120),(210, 90,130),(180,230,160)), ((255,200,100),(100,190,230),(240,160,200)), ((140,100,220),(200,180, 60),(180,130,240)), ((200,220,120),( 80,130,210),(140,230,200)), ((255,150,100),(120, 80,200),(255,200,150)), ];
#[rustfmt::skip]
pub const PALETTE_DARK: &[GradientTriple] = &[
((200,180,100),(180,120,100),(190,210,130)), ((180,140,100),(120,170,160),(200,170,130)), ((140,180,170),(190,160,100),(170,200,180)), ((170,140,180),(180,190,110),(185,160,195)), ((150,190,130),(190,130,120),(175,200,150)), ((190,150,100),(130,170,180),(210,180,120)), ((130,160,190),(180,150,170),(155,175,205)), ((185,140,130),(140,185,160),(200,165,140)), ((140,185,160),(185,165,100),(155,190,170)), ((165,150,190),(150,185,140),(180,165,205)), ((195,175,110),(130,155,185),(175,195,190)), ((150,185,130),(185,130,130),(170,195,150)), ((205,185,120),(140,170,195),(195,170,155)), ((160,140,195),(185,180,110),(170,150,200)), ((180,195,130),(130,150,185),(165,195,165)), ((200,160,120),(140,140,190),(200,175,135)), ];
#[rustfmt::skip]
pub const PALETTE_LIGHT: &[GradientTriple] = &[
(( 30, 90,180),( 20,150,120),( 50,140,200)), ((180, 80, 60),( 40,120,180),(200,110, 80)), (( 50,150, 90),(170,130, 50),( 80,160,120)), ((130, 60,150),(180,140, 30),(150, 80,170)), (( 40,160,130),(170, 60, 70),( 80,170,140)), ((190,110, 50),( 50,130,170),(210,140, 60)), (( 60,120,190),(160, 90,140),(100,150,210)), ((170, 70, 70),( 50,160,130),(190,100, 80)), (( 50,160,140),(180,130, 40),( 80,170,150)), ((140, 80,170),( 60,150, 80),(160,100,190)), ((190,140, 40),( 60,110,180),(120,160,190)), (( 60,150, 70),(170, 60, 80),( 90,160, 90)), ((200,130, 60),( 50,140,190),(180,100,120)), ((120, 60,190),(180,150, 30),(140, 80,210)), ((160,170, 50),( 50, 90,170),(100,170,140)), ((200, 90, 50),( 80, 50,170),(210,120, 70)), ];
#[rustfmt::skip]
pub const PALETTE_NORD: &[GradientTriple] = &[
((136,192,208),(163,190,140),(143,188,187)), ((180,142,173),( 94,168,174),(191,160,180)), (( 94,168,174),(136,192,208),(143,188,187)), ((163,190,140),(180,142,173),(170,200,160)), ((143,188,187),(210,160,130),(160,195,190)), ((180,170,150),( 94,168,174),(200,185,160)), ((120,175,200),(170,150,180),(145,190,200)), ((170,155,175),(130,185,175),(185,165,160)), ((130,185,175),(175,165,140),(145,190,180)), ((160,145,190),(143,188,187),(175,155,200)), ((175,165,135),(120,170,195),(160,185,180)), ((143,190,155),(175,145,165),(155,195,170)), ((185,175,145),(130,175,190),(175,155,170)), ((150,140,190),(170,175,140),(160,150,200)), ((165,185,150),(120,160,195),(150,190,170)), ((185,160,145),(130,145,190),(190,170,155)), ];
#[rustfmt::skip]
pub const PALETTE_MONOKAI: &[GradientTriple] = &[
((230,219,116),(249, 38,114),(166,226, 46)), ((249, 38,114),(102,217,239),(255, 95,100)), ((102,217,239),(166,226, 46),(174,220,230)), ((174,129,255),(230,219,116),(200,150,255)), ((166,226, 46),(249, 38,114),(200,240, 80)), ((255,151, 50),(102,217,239),(255,200, 80)), ((102,217,239),(200,100,220),(150,220,250)), ((249, 70,100),(166,226, 46),(255,120, 90)), ((166,226, 46),(255,151, 50),(200,240,120)), ((200,130,255),(166,226, 46),(220,160,255)), ((255,200, 80),(102,217,239),(230,230,150)), ((166,226, 46),(249, 38,114),(200,240,100)), ((255,180, 80),(102,217,239),(255,120,180)), ((174,129,255),(230,219,116),(190,160,255)), ((230,230,120),(102,180,230),(200,240,200)), ((255,120, 80),(174,129,255),(255,160,100)), ];
#[rustfmt::skip]
pub const PALETTE_TERMINAL: &[GradientTriple] = &[
((160,160,160),(120,120,120),(175,175,175)), ((170,170,170),(110,110,110),(180,180,180)), ((130,130,130),(165,165,165),(145,145,145)), ((155,155,155),(140,140,140),(170,170,170)), ((140,140,140),(160,160,160),(150,150,150)), ((165,165,165),(125,125,125),(175,175,175)), ((120,120,120),(170,170,170),(135,135,135)), ((160,150,150),(135,155,155),(170,160,160)), ((135,155,155),(160,150,150),(145,160,160)), ((150,140,165),(145,160,150),(160,145,170)), ((165,160,140),(125,145,160),(155,165,155)), ((145,160,145),(160,140,150),(155,165,150)), ((170,160,145),(135,150,165),(160,155,150)), ((150,140,165),(160,160,140),(155,145,170)), ((160,165,145),(130,140,155),(150,165,155)), ((165,150,140),(140,140,160),(170,155,145)), ];
#[rustfmt::skip]
pub const PALETTE_ANTHROPIC_LIGHT: &[GradientTriple] = &[
((180,100, 70),( 70,130, 80),(200,130, 80)), ((160, 80, 60),( 80,100,160),(180,110, 70)), (( 70,130, 90),(170,120, 50),( 90,140,100)), ((130, 80,120),(170,130, 40),(140, 90,130)), (( 80,140,100),(160, 70, 60),(100,150,110)), ((180,110, 50),( 60,120,150),(200,130, 60)), (( 70,100,150),(140, 80,110),( 90,110,165)), ((160, 70, 60),( 70,140,120),(180, 90, 70)), (( 70,140,120),(170,120, 40),( 90,150,130)), ((130, 80,140),( 70,140, 80),(145, 90,155)), ((180,130, 40),( 70, 90,150),(120,140,150)), (( 70,140, 70),(160, 70, 80),( 90,150, 90)), ((190,120, 50),( 60,120,160),(170, 90,100)), ((110, 60,160),(170,140, 30),(120, 70,175)), ((150,140, 50),( 50, 80,150),(100,150,120)), ((190, 80, 40),( 80, 50,140),(200,100, 55)), ];
#[rustfmt::skip]
pub const PALETTE_ANTHROPIC_DARK: &[GradientTriple] = &[
((130,170,255),(192,153,255),(140,230,180)), ((255,140,120),(100,180,255),(255,170,140)), ((100,200,200),(180,140,255),(130,220,210)), ((180,140,255),(255,200,100),(200,160,255)), ((100,220,160),(255,120,130),(130,230,180)), ((255,170, 80),(100,180,230),(255,200,110)), ((100,180,255),(200,130,220),(140,200,255)), ((255,120,130),(100,220,200),(255,150,140)), ((100,220,200),(255,180, 80),(130,230,210)), ((200,160,255),(100,220,160),(220,180,255)), ((255,200,100),(100,170,255),(200,220,150)), ((100,220,160),(255,120,140),(130,230,180)), ((255,180,100),(100,200,220),(255,140,180)), ((170,130,255),(255,200,100),(190,150,255)), ((200,220,120),(100,140,240),(150,230,200)), ((255,140, 80),(140,100,255),(255,170,100)), ];
pub fn get_gradient(palette: u8, idx: usize) -> GradientTriple {
let i = idx % 16;
match palette % 8 {
0 => PALETTE_MIDNIGHT[i],
1 => PALETTE_DARK[i],
2 => PALETTE_LIGHT[i],
3 => PALETTE_NORD[i],
4 => PALETTE_MONOKAI[i],
5 => PALETTE_TERMINAL[i],
6 => PALETTE_ANTHROPIC_LIGHT[i],
_ => PALETTE_ANTHROPIC_DARK[i],
}
}