1use crate::config::ColorConfig;
3use colored::Color;
4
5#[derive(Debug, Clone, Copy)]
6pub enum FileIcon {
7 Directory,
8 Executable,
9 RegularFile,
10}
11
12impl FileIcon {
14 pub fn as_str(&self) -> &str {
15 match self {
16 FileIcon::Directory => "",
17 FileIcon::Executable => "",
18 FileIcon::RegularFile => "",
19 }
20 }
21
22 pub fn get_color(&self, config: &ColorConfig) -> Color {
23 match self {
24 FileIcon::Directory => config.get_directory_color(),
25 FileIcon::Executable => config.get_executable_color(),
26 FileIcon::RegularFile => config.get_regular_color(),
27 }
28 }
29}