增加展示颜色分量单位功能。

This commit is contained in:
徐涛 2024-12-31 11:24:25 +08:00
parent 71978c1357
commit 3524568fec

View File

@ -6,6 +6,7 @@ import styles from './ColorRangePicker.module.css';
type ColorRangePickerProps = {
title: string;
value?: number;
unit?: string;
onChange: (value: number) => void;
gradient: string;
min?: number;
@ -17,6 +18,7 @@ type ColorRangePickerProps = {
export function ColorRangePicker({
title,
value = 0,
unit,
onChange,
gradient,
min = 0,
@ -41,7 +43,10 @@ export function ColorRangePicker({
<div className={styles.picker_container}>
<div className={styles.title_row}>
<label>{title}</label>
<span>{pickerValue}</span>
<span>
{pickerValue}
{unit}
</span>
</div>
<input
type="range"