import gleam/int import gleam/result import gleam_community/colour.{type Colour, white} pub type CatppuccinColor { CatppuccinColor(name: String, order: Int, accent: Bool, color: Colour) } /// Converts rgb values to a `Colour`. /// returns white as a fallback color, if the conversion fails. /// this is used by the lib (probably should've been a private function) /// pub fn to_community_colour(r r: Int, g g: Int, b b: Int) -> Colour { colour.from_rgb(r: int.to_float(r), g: int.to_float(g), b: int.to_float(b)) |> result.unwrap(white) }