1.1.6 • Published 8 months ago

@ray-js/lamp-color-wheel v1.1.6

Weekly downloads
-
License
MIT
Repository
-
Last release
8 months ago

English | 简体中文

@ray-js/lamp-color-wheel

latest download

彩色圆形选择色环

Installation

$ npm install @ray-js/components-ty-lamp
// 或者
$ yarn add @ray-js/components-ty-lamp

Usage

interface IProps {
  /**
   * @description.zh 色盘中心空洞半径
   * @description.en Color disc center cavity radius
   * @default 21
   */
  hollowRadius?: number;
  /**
   * @description.zh 色盘中心圆半径
   * @description.en Color disc center circle radius
   * @default 17
   */
  centerRingRadius?: number;
  /**
   * @description.zh hs颜色
   * @description.en { h: number; s: number } color
   * @default {h:0,s:800}
   */
  hsColor?: { h: number; s: number };
  /**
   * @description.zh 色盘半径
   * @description.en Color wheel radius
   * @default 160
   */
  ringRadius?: number;
  /**
   * @description.zh 选中按钮边框宽度
   * @description.en Select button border width
   * @default 5
   */
  thumbBorderWidth?: number;
  /**
   * @description.zh 选中按钮边框颜色
   * @description.en Select button border color
   * @default '#fff'
   */
  thumbBorderColor?: string;
  /**
   * @description.zh 点击结束事件
   * @description.en Click on the end event
   * @default ()=>null
   */
  onTouchEnd?: (e: { h: number; s: number }) => void;
  /**
   * @description.zh 内边距
   * @description.en padding
   * @default 5
   */
  paddingWidth?: number;
}
import { LampColorWheel } from '@ray-js/components-ty-lamp';

export default () => {
  const [color, setColor] = useState({ h: 0, s: 800 });
  const handleEnd = (e: { h: number; s: number }) => {
    setColor(e);
  };
  return (
    <LampColorWheel
      hsColor={color}
      hollowRadius={21}
      centerRingRadius={17}
      ringRadius={160}
      paddingWidth={20}
      onTouchEnd={handleEnd}
    />
  );
};
1.1.6

8 months ago

1.1.5

10 months ago

1.1.6-beta-1

8 months ago

1.1.4-beta-1

1 year ago

1.1.4

1 year ago

1.1.3

1 year ago

1.1.3-beta-2

1 year ago

1.1.3-beta-1

1 year ago

1.1.2-beta-1

1 year ago

1.0.1

1 year ago

1.0.1-beta-1

1 year ago

1.1.2

1 year ago

1.0.0

1 year ago