code.gitea.io/gitea@v1.21.7/web_src/js/features/comp/ColorPicker.js (about)

     1  import $ from 'jquery';
     2  import {createColorPicker} from '../colorpicker.js';
     3  
     4  export function initCompColorPicker() {
     5    createColorPicker($('.color-picker'));
     6  
     7    $('.precolors .color').on('click', function () {
     8      const color_hex = $(this).data('color-hex');
     9      $('.color-picker').val(color_hex);
    10      $('.minicolors-swatch-color').css('background-color', color_hex);
    11    });
    12  }