mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2025-11-17 18:21:28 +10:00
feat(templates): redesign and add back in the original templates from v3
This commit is contained in:
@ -1,4 +1,5 @@
|
||||
export * from "./namespaces/array";
|
||||
export * from "./namespaces/color";
|
||||
export * from "./namespaces/csv";
|
||||
export * from "./namespaces/date";
|
||||
export * from "./namespaces/error";
|
||||
|
||||
11
libs/utils/src/namespaces/color.ts
Normal file
11
libs/utils/src/namespaces/color.ts
Normal 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})`;
|
||||
}
|
||||
};
|
||||
@ -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
|
||||
|
||||
@ -3,7 +3,10 @@ export const templatesList = [
|
||||
"bronzor",
|
||||
"chikorita",
|
||||
"ditto",
|
||||
"gengar",
|
||||
"glalie",
|
||||
"kakuna",
|
||||
"leafish",
|
||||
"nosepass",
|
||||
"onyx",
|
||||
"pikachu",
|
||||
|
||||
Reference in New Issue
Block a user