This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//* Based on useIdleTimer (TC-Webapp) | |
import React from "react"; | |
const useIdleTimerHook = (isActive: boolean, onIdle: Function, defaultTimeout_ms = 3600 * 1000): void => { | |
// console.log("isActive:", isActive); | |
const timerRef: React.MutableRefObject<number | null> = React.useRef<number | null>(null); | |
const resetTimer = React.useCallback(() => { | |
if (timerRef.current) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//* Based on getTriadicColors (TC-Webapp) | |
//* https://en.wikipedia.org/wiki/Color_wheel | |
// How to use: | |
// Get 3 colors to red every 90deg (Square Colors) | |
const redHexColor = "#ff0000"; // red in hex | |
const threeNewColors = getWheelColors(redHexColor, 3); | |
console.log("threeNewColors:", threeNewColors); // threeNewColors: [ '#80ff00', '#00ffff', '#8000ff' ] | |
interface RGB { |