react-color#CustomPicker TypeScript Examples

The following examples show how to use react-color#CustomPicker. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: index.tsx    From gant-design with MIT License 5 votes vote down vote up
WithWrap = CustomPicker(ColorPicker)
Example #2
Source File: SpectrumPalette.tsx    From grafana-chinese with Apache License 2.0 5 votes vote down vote up
SpectrumPicker = CustomPicker<Themeable>(({ rgb, hsl, onChange, theme }) => {
  return (
    <div
      style={{
        display: 'flex',
        width: '100%',
        flexDirection: 'column',
      }}
    >
      <div
        style={{
          display: 'flex',
        }}
      >
        <div
          style={{
            display: 'flex',
            flexGrow: 1,
            flexDirection: 'column',
          }}
        >
          <div
            style={{
              position: 'relative',
              height: '100px',
              width: '100%',
            }}
          >
            {/*
      // @ts-ignore */}
            <Saturation onChange={onChange} hsl={hsl} hsv={tinycolor(hsl).toHsv()} />
          </div>
          <div
            style={{
              width: '100%',
              height: '16px',
              marginTop: '16px',
              position: 'relative',
              background: 'white',
            }}
          >
            {/*
      // @ts-ignore */}
            <Alpha rgb={rgb} hsl={hsl} a={rgb.a} onChange={onChange} pointer={renderPointer(theme)} />
          </div>
        </div>

        <div
          style={{
            position: 'relative',
            width: '16px',
            height: '100px',
            marginLeft: '16px',
          }}
        >
          {/*
        // @ts-ignore */}
          <Hue onChange={onChange} hsl={hsl} direction="vertical" pointer={renderPointer(theme)} />
        </div>
      </div>
    </div>
  );
})