diff --git a/src/components/ColorComponentInput.tsx b/src/components/ColorComponentInput.tsx index 7b196de..15d24cc 100644 --- a/src/components/ColorComponentInput.tsx +++ b/src/components/ColorComponentInput.tsx @@ -1,6 +1,6 @@ import { Icon } from '@iconify/react/dist/iconify.js'; import cx from 'clsx'; -import { clamp, divide, floor, times, trim } from 'lodash-es'; +import { clamp, divide, floor, multiply, trim } from 'lodash-es'; import { ChangeEvent, useEffect, useState } from 'react'; import { useColorFunction } from '../ColorFunctionContext'; import styles from './ColorComponentInput.module.css'; @@ -50,8 +50,8 @@ export function ColorComponentInput({ color, onChange }: ColorComponentInputProp try { const [h, s, l] = colorFn?.represent_hsl(colorValue) ?? [0, 0, 0]; setH(floor(h, 1)); - setS(floor(times(s, 100), 2)); - setL(floor(times(l, 100), 2)); + setS(floor(multiply(s, 100), 2)); + setL(floor(multiply(l, 100), 2)); } catch (e) { console.error('[Convert HSL]', e); } @@ -143,8 +143,8 @@ export function ColorComponentInput({ color, onChange }: ColorComponentInputProp setB(b); const [h, s, l] = colorFn?.represent_hsl(color) ?? [0, 0, 0]; setH(floor(h, 1)); - setS(floor(times(s, 100), 2)); - setL(floor(times(l, 100), 2)); + setS(floor(multiply(s, 100), 2)); + setL(floor(multiply(l, 100), 2)); } catch (e) { console.error('[Convert RGB]', e); }