Colorpicker - Spectrum > 공책

본문 바로가기
010.6356.7610
  • design1001@naver.com
  • @design1001
작업물 전체보기

JQuery+JavaScript

JQuery+JavaScript Colorpicker - Spectrum

페이지 정보

  • 작성자후야
  • 조회 : 195
  • 작성일 : 2021-01-28 00:21

본문

//CDN
<script src="https://cdn.jsdelivr.net/npm/spectrum-colorpicker2/dist/spectrum.min.js">
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/spectrum-colorpicker2/dist/spectrum.min.css">

<input id="color-picker" value='#276cb8' />

<script>
$('#color-picker').spectrum({
  type: "component"
});

//options
$("#picker").spectrum({
    color: tinycolor,
    type: sting, // text, component, color, flat
    showInput: bool,
    showInitial: bool,
    allowEmpty: bool,
    showAlpha: bool,
    disabled: bool,
    localStorageKey: string,
    showPalette: bool,
    showPaletteOnly: bool,
    togglePaletteOnly: bool,
    showSelectionPalette: bool,
    clickoutFiresChange: bool,
    containerClassName: string,
    replacerClassName: string,
    preferredFormat: string,
    maxSelectionSize: int,
    palette: [[string]],
    selectionPalette: [string],
    // specify locale
    locale: string,
    // or directly change the translations
    cancelText: string,
    chooseText: string,
    togglePaletteMoreText: string,
    togglePaletteLessText: string,
    clearText: string,
    noColorSelectedText: string,
});
</script>

첨부파일