27 lines
889 B
TypeScript
27 lines
889 B
TypeScript
import LabAndImg from "@/components/LabAndImg"
|
|
import { Image, View } from "@tarojs/components"
|
|
import styles from './index.module.scss'
|
|
|
|
export type colorItem = {
|
|
title: string,
|
|
lab: {l:number, a:number, b:number},
|
|
rgb: {r:number, g:number, b:number},
|
|
texture_url: string
|
|
}
|
|
export type colorParams = {
|
|
value?: colorItem,
|
|
show?: false|true
|
|
onClose?: () => void
|
|
}
|
|
export default ({value, show = false, onClose}: colorParams) => {
|
|
return (
|
|
<>
|
|
{show&&<View className={styles.main} catch-move="true" onClick={() => onClose?.()}>
|
|
<View className={styles.con}>
|
|
<LabAndImg value={{lab:value?.lab,rgb:value?.rgb,texture_url:value?.texture_url}}/>
|
|
<View className={styles.name}>{value?.title}</View>
|
|
</View>
|
|
</View>}
|
|
</>
|
|
)
|
|
} |