feat(templates): redesign and add back in the original templates from v3

This commit is contained in:
Amruth Pillai
2023-11-26 14:33:40 +01:00
parent 765bf71220
commit 446c5db68f
30 changed files with 2817 additions and 415 deletions

View File

@ -1,4 +1,5 @@
export * from "./namespaces/array";
export * from "./namespaces/color";
export * from "./namespaces/csv";
export * from "./namespaces/date";
export * from "./namespaces/error";

View File

@ -0,0 +1,11 @@
export const hexToRgb = (hex: string, alpha: number = 0) => {
const r = parseInt(hex.slice(1, 3), 16),
g = parseInt(hex.slice(3, 5), 16),
b = parseInt(hex.slice(5, 7), 16);
if (alpha) {
return `rgba(${r}, ${g}, ${b}, ${alpha})`;
} else {
return `rgb(${r}, ${g}, ${b})`;
}
};

View File

@ -8,5 +8,3 @@ export const linearTransform = (
if (inMax === inMin) return value === inMax ? outMin : NaN;
return ((value - inMin) * (outMax - outMin)) / (inMax - inMin) + outMin;
};
// Handle this case: returns output minimum if input maximum equals input minimum

View File

@ -3,7 +3,10 @@ export const templatesList = [
"bronzor",
"chikorita",
"ditto",
"gengar",
"glalie",
"kakuna",
"leafish",
"nosepass",
"onyx",
"pikachu",