This commit is contained in:
Nathan Bierema 2020-08-26 16:34:28 -04:00
parent 05e3d898a2
commit 90dbb8d940
2 changed files with 18 additions and 4 deletions

View File

@ -1,11 +1,25 @@
export const UPDATE_SCROLL_TOP =
'@@redux-devtools-log-monitor/UPDATE_SCROLL_TOP';
export function updateScrollTop(scrollTop) {
interface UpdateScrollTopAction {
type: typeof UPDATE_SCROLL_TOP;
scrollTop: number;
}
export function updateScrollTop(scrollTop: number): UpdateScrollTopAction {
return { type: UPDATE_SCROLL_TOP, scrollTop };
}
export const START_CONSECUTIVE_TOGGLE =
'@@redux-devtools-log-monitor/START_CONSECUTIVE_TOGGLE';
export function startConsecutiveToggle(id) {
interface StartConsecutiveToggleAction {
type: typeof START_CONSECUTIVE_TOGGLE;
id: number | null;
}
export function startConsecutiveToggle(
id: number | null
): StartConsecutiveToggleAction {
return { type: START_CONSECUTIVE_TOGGLE, id };
}
export type LogMonitorAction =
| UpdateScrollTopAction
| StartConsecutiveToggleAction;

View File

@ -1,9 +1,9 @@
export default function (hexColor, lightness) {
export default function (hexColor: string, lightness: number) {
let hex = String(hexColor).replace(/[^0-9a-f]/gi, '');
if (hex.length < 6) {
hex = hex.replace(/(.)/g, '$1$1');
}
let lum = lightness || 0;
const lum = lightness || 0;
let rgb = '#';
let c;