|
@@ -1,13 +1,19 @@
|
|
use lazy_static::lazy_static;
|
|
use lazy_static::lazy_static;
|
|
use std::collections::HashMap;
|
|
use std::collections::HashMap;
|
|
|
|
|
|
|
|
+/// A description of a DMC thread color
|
|
#[derive(Copy, Clone, Debug)]
|
|
#[derive(Copy, Clone, Debug)]
|
|
pub struct DMC {
|
|
pub struct DMC {
|
|
|
|
+ /// The "number" (which may not be) of the thread
|
|
pub number: &'static str,
|
|
pub number: &'static str,
|
|
|
|
+ /// The human-readable color name
|
|
pub name: &'static str,
|
|
pub name: &'static str,
|
|
|
|
+ /// The RGB values
|
|
pub color: (f64, f64, f64),
|
|
pub color: (f64, f64, f64),
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+/// This was scraped from the internet and can be re-scraped again if
|
|
|
|
+/// needed
|
|
pub const COLORS: &[DMC] = &[
|
|
pub const COLORS: &[DMC] = &[
|
|
DMC {
|
|
DMC {
|
|
number: "3713",
|
|
number: "3713",
|
|
@@ -2457,6 +2463,7 @@ pub const COLORS: &[DMC] = &[
|
|
];
|
|
];
|
|
|
|
|
|
lazy_static! {
|
|
lazy_static! {
|
|
|
|
+ /// A lookup table by DMC "number" to the DMC descriptions above
|
|
pub static ref LOOKUP: HashMap<&'static str, &'static DMC> = {
|
|
pub static ref LOOKUP: HashMap<&'static str, &'static DMC> = {
|
|
let mut map = HashMap::new();
|
|
let mut map = HashMap::new();
|
|
for dmc in COLORS {
|
|
for dmc in COLORS {
|