GithubHelp home page GithubHelp logo

easylogic / colorpicker Goto Github PK

View Code? Open in Web Editor NEW
44.0 44.0 8.0 1.82 MB

pure js colorpicker

Home Page: https://colorpicker.easylogic.studio

License: MIT License

JavaScript 76.30% HTML 2.29% SCSS 21.37% Shell 0.05%

colorpicker's Introduction

Hi there ๐Ÿ‘‹

์•ˆ๋…•ํ•˜์„ธ์š”, ์ด์ง€๋กœ์ง์ž…๋‹ˆ๋‹ค.

์†Œ๊ฐœ๋ฅผ ํ•˜๊ณ  ์‹ถ์€๋ฐ ํ•  ์ค„ ์•„๋Š”๊ฒŒ ๋ณ„๋กœ ์—†๋„ค์š”.

์Šคํ‚ฌ : JS

์ด๋งŒ ์ค„์ด๊ฒ ์Šต๋‹ˆ๋‹ค.

์•„์ฐธ, ์›น์—์„œ ์—ฌ๋Ÿฌ๊ฐ€์ง€ ์šฉ๋„๋กœ ์“ธ ์ˆ˜ ์žˆ๋Š” ๋””์ž์ธ ํˆด์„ ํ•˜๋‚˜ ๋งŒ๋“ค๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค.

๊ฐ™์ด ๋งŒ๋“ค์–ด ๋ณด์‹ค ๋ถ„ ?


I am easylogic.

I have only one skill : javascript.

Thank you.

colorpicker's People

Contributors

easylogic avatar redgoose-dev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

colorpicker's Issues

not able to add a new gradient stop

Describe the bug
unable to add a new gradient stop

To Reproduce
Steps to reproduce the behavior:
you can also see the issue in your website https://colorpicker.easylogic.studio
it doesn't work if you click in between any of gradient stops. getting this error
image
image

but if you move the last stop a little bit to the middle, then you can add a new stop after that

with gradient

๊ฐœ๋ฐœํ™”๋ฉด์—์„œ ๊ทธ๋ผ๋””์–ธํŠธ ์ปดํฌ๋„ŒํŠธ๊ฐ€ ์ถ”๊ฐ€ ๋˜์—ˆ๋Š”๋ฐ ๊ทธ์—๋Œ€ํ•œ ์˜ˆ์ œํ™”๋ฉด์„ ์กฐ์ •ํ•  ํ•„์š”๊ฐ€ ์žˆ์Šต๋‹ˆ๋‹ค.

์Šคํƒ€์ผ์‹œํŠธ์™€ ์ปจํŠธ๋กค๋Ÿฌ ์„น์…˜์˜ ๊ธฐ๋Šฅ์„ ์กฐ์ •ํ•  ์˜ˆ์ •์ž…๋‹ˆ๋‹ค.

์ปฌ๋Ÿฌํ”ผ์ปค ๊ฐœ์„ ์š”์†Œ๋“ค ๋ชฉ๋ก

์ปฌ๋Ÿฌํ”ผ์ปค ๊ฐœ์„ ์— ๋Œ€ํ•ด ์ญ‰ ์ ์–ด๋ด์š”.
๋‹จ์ˆœํžˆ ์ƒ‰์ƒ์„ ์„ ํƒํ•˜๋Š” ๋„๊ตฌ๋ฅผ 100kb ์ด์ƒ ์‚ฌ์šฉํ•˜๋Š”๊ฒƒ์€ ์ด์šฉํ•˜๋Š” ์ž…์žฅ์—์„œ ๋ถ€๋‹ด์ด ํฝ๋‹ˆ๋‹ค. ์ปดํฌ๋„ŒํŠธ๋ฅผ ๋”์šฑ ๋‹จ์ˆœํ™”์‹œ์ผœ ์—ญํ• ์— ๋” ์ง‘์ค‘ํ•˜๊ณ  ๊ฒฝ๋Ÿ‰ํ™” ์‹œํ‚ค๋Š”๋ฐ ๋ชฉํ‘œ๋ฅผ ๋‘ฌ์•ผ ํ•œ๋‹ค๊ณ  ๋ด…๋‹ˆ๋‹ค.

์šฐ์„  ์ œ๊ฐ€ ํ•  ์ˆ˜ ์žˆ๋Š” ์ผ๋“ค์— ๋Œ€ํ•˜์—ฌ ์ž‘์„ฑํ–ˆ์Šต๋‹ˆ๋‹ค.

SCSS

์Šคํƒ€์ผ์‹œํŠธ์— ๊ด€ํ•œ ์ฝ”๋“œ๊ฐœ์„  ๋ฐฉ์•ˆ์ž…๋‹ˆ๋‹ค.

ํด๋ž˜์Šค ์ด๋ฆ„ ๋ณ€๊ฒฝ

.easylogic-colorpicker์ด๋ฆ„์ด ๊ฝค ๊ธดํŽธ์ด๊ณ , ๋ฒˆ๋“ค๋ง์ด ๋˜์—ˆ์„๋•Œ ํฐ ์šฉ๋Ÿ‰์ด ๋งŒ๋“ค์–ด์ง€๋Š” ์š”์ธ์ค‘ ํ•˜๋‚˜๊ฐ€ ๋ฉ๋‹ˆ๋‹ค.
์•„๋งˆ๋„ .el-colorpicker ๊ฐ™์€ ๋ชจ์Šต์œผ๋กœ ์กฐ๊ธˆ์ด๋ผ๋„ ์ค„์ผ ํ•„์š”๊ฐ€ ์žˆ์Šต๋‹ˆ๋‹ค. ์ด๋ฆ„ ํ”„๋ฆฌํ”ฝ์Šค ์ •๋„๋Š” ์••์ถ•์„ ํ•ด๋„ ๋ฌธ์ œ์—†์„ ๊ฒƒ์ž…๋‹ˆ๋‹ค.

์…€๋ ‰ํ„ฐ ์ค‘์ฒฉ ์ค„์ด๊ธฐ

.colorsets > .menu button ๊ฐ™์€ ๋ชจ์Šต์€ ๊ทธ๋‚˜๋งˆ ๊ดœ์ฐฎ์€ ํŽธ์ด์ง€๋งŒ ๋งŽ์•„์ง€๋ฉด ๋ฒˆ๋“ค๋ง์— ์ฝ”๋“œ๊ฐ€ ๋งŽ์•„์ง€๊ธด ํ•ฉ๋‹ˆ๋‹ค.
์•„๋งˆ๋„ .colorsets-menu button, .colorsets__menu button ๋ชจ์Šต์œผ๋กœ BEM ํ˜•์‹์œผ๋กœ css๋ฅผ ์ž‘์„ฑํ•  ์š”๋Ÿ‰์ž…๋‹ˆ๋‹ค.

๋‹จ์–ด ํ˜•์‹์˜ ํด๋ž˜์Šค ์ด๋ฆ„์€ ํ”ผํ•˜๊ธฐ

.color, .menu๊ฐ™์€ ๋ชจ์Šต์œผ๋กœ ํด๋ž˜์Šค ์ด๋ฆ„์„ ์ง€์ •ํ•˜๋ฉด ์™ธ๋ถ€ ์š”์†Œ์—์„œ ๊ฐ„์„ญํ•˜๋Š” ํ™œ๋ฅ ์ด ๋Œ€๋‹จํžˆ ๋†’์Šต๋‹ˆ๋‹ค. ํ”ํ•˜๊ฒŒ ์‚ฌ์šฉํ•˜๋Š” ๋‹จ์–ด๋Š” ํ”ผํ•ด์•ผ ํ•˜๋ฏ€๋กœ ํ”„๋ฆฌํ”ฝ์Šค๋ฅผ ๋ถ™์ด๊ฑฐ๋‚˜ ์ปดํฌ๋„ŒํŠธ๋ณ„๋กœ ํ’€๋„ค์ž„์œผ๋กœ ์‚ฌ์šฉํ•˜๋Š”๊ฒƒ์ด ์ข‹์„๊ฑฐ ๊ฐ™์Šต๋‹ˆ๋‹ค.
.el-colorpicker-color ๊ฐ™์€ ๋ชจ์Šต์ด ๋˜๋ฉด ์ค‘์ฒฉ์‹œํ‚ฌ ํ•„์š”์—†์ด ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ์–ด์„œ scss ํŒŒ์ผ์„ ๋‹ค๋ฅธ ๊ณต๊ฐ„์œผ๋กœ ๋บ„ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

์ปดํฌ๋„ŒํŠธ๋ณ„๋กœ scss ํŒŒ์ผ์„ ์œ„์น˜์‹œํ‚ค๊ธฐ

์ผ๋ถ€๋ถ„ ์ปดํฌ๋„ŒํŠธํ™” ๋˜์–ด์žˆ๋Š” ๋ชจ์Šต์ด ๋ณด์ด๋Š”๋ฐ ์ด ๋ถ€๋ถ„์€ ์ข€ ํ…Œ์ŠคํŠธ์™€ ๊ฒ€์ฆ์ด ํ•„์š”ํ•ด ๋ณด์ž…๋‹ˆ๋‹ค.
scss/ ๊ณต๊ฐ„์— ์Šคํƒ€์ผ์‹œํŠธ ํŒŒ์ผ๋“ค์„ ๋ชฐ์•„๋„ฃ์—ˆ์ง€๋งŒ ๊ด€๋ฆฌ๊ฐ€ ์ฐธ ํž˜๋“ค๊ธด ํ•ฉ๋‹ˆ๋‹ค. ^^;
์ด๊ฑด ์ข€ ๊ณ ๋ฏผ์„ ์ข€ ํ•ด๋ณด๊ฒ ์Šต๋‹ˆ๋‹ค.

์ปฌ๋Ÿฌ ๊ทœ๊ฒฉ ์ •ํ•˜๊ธฐ

์–ด๋– ํ•œ ์ปฌ๋Ÿฌ๋ฅผ ์‚ฌ์šฉํ• ์ง€ ์ •ํ•ด์„œ ๋ณ€์ˆ˜ํ™” ์‹œํ‚ฌ ์˜ˆ์ •์ž…๋‹ˆ๋‹ค.

Theme

์šฐ์„ ์€ ๊ธฐ๋ณธํ…Œ๋งˆ์— ์ง‘์ค‘ํ•˜๊ณ  ์‹ถ์Šต๋‹ˆ๋‹ค. ๊ธฐ๋ณธ๊ฐ’ ์ด๋ฆ„์ด chromedevtool์œผ๋กœ ๋˜์–ด์žˆ์ง€๋งŒ default๋กœ ๋ณ€๊ฒฝํ•˜๊ณ  ํฌ๊ฒŒ UI๊ฐ€ ๋ณ€ํ•˜๋Š” ํ…Œ๋งˆ๋กœ ๊ณจ๋ผ๋‚ด์„œ ์‚ฌ์šฉํ•˜๋Š”๊ฒƒ์ด ์ข‹์„๊ฑฐ๋ผ ์ƒ๊ฐํ•ฉ๋‹ˆ๋‹ค.

  • default
  • xd
  • macos
  • ring
  • mini-vertical (mini๋กœ ํ•ฉ์ณ์„œ ํ•œ๊ฐœ๋กœ..)

๊ธฐ๋ณธ๊ฐ’์˜ ๋””์ž์ธ์€ ๋‹ค์Œ๊ณผ ๊ฐ™์„ ์˜ˆ์ •์ž…๋‹ˆ๋‹ค.

easylogic-colorpicker

Javascript

import

import Color from '../../util/Color';

๋ชจ์Šต์œผ๋กœ import๋กœ ๋˜์–ด์žˆ๋Š”๋ฐ ๋‹ค์Œ๊ณผ ๊ฐ™์ด ์ž‘์„ฑํ•˜์—ฌ ๋ถˆ๋Ÿฌ์˜ฌ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

import Color from '~/util/Color';

implement a clear button

hey there

I was looking for a way to implement a button that clears all values and indicators
what's the easiest way to do this?

์˜ต์…˜๊ณผ ์ฝœ๋ฐฑ ๊ตํ†ต์ •๋ฆฌ

์†Œ์Šค์ฝ”๋“œ์—์„œ ์˜ต์…˜๊ณผ ์ฝœ๋ฐฑ, ๊ณต๊ฐœ ๋ฉ”์„œ๋“œ๋“ค์ด ์ •๋ฆฌ์•„ ์•ˆ๋˜์–ด ์ •๋ฆฌํ•˜๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค.

์ž‘์—… ์ˆœ์„œ

  • ์•ˆ์“ฐ๋Š” ๋ฉ”์„œ๋“œ์™€ ์˜ต์…˜๋“ค ์‚ญ์ œ
  • ์‚ฌ์šฉํ•˜๋Š” ์˜ต์…˜๋“ค ๋ชฉ๋กํ™”
  • ์‚ฌ์šฉํ•˜๋Š” ์ฝœ๋ฐฑํ•จ์ˆ˜ ์‚ฌ์šฉ๋ฐฉ๋ฒ• ์žฌ์ •์˜ (ํ˜„์žฌ ์ธ์Šคํ„ด์Šค์™€ ์˜ต์…˜์œผ๋กœ ์ด๋ฒคํŠธ ํ˜ธ์ถœ๋ฐฉ์‹์ด ํˆฌํŠธ๋ž™์œผ๋กœ ๋˜์–ด์žˆ์Šต๋‹ˆ๋‹ค.)
  • ๊ณต๊ฐœ๋œ ๋ฉ”์„œ๋“œ์™€ ๊ฐ’ ์ •๋ฆฌ (ํ˜„์žฌ๋Š” ์ „๋ถ€ ๊ณต๊ฐœ๋˜์–ด์žˆ์–ด ๋ณด์ž…๋‹ˆ๋‹ค.)

๋“œ๋กญ๋‹ค์šด์— ๊ด€ํ•œ ๊ธฐ๋Šฅ

์ผ๋‹จ ์ˆจ๊ธฐ๋Š” ๊ธฐ๋Šฅ์„ ๊ฐ€์ง„ ๊ธฐ๋Šฅ์„ ๋‹ค ๋นผ๋‘๊ณ  ๋‹ค์‹œ ๊ตฌํ˜„ํ•  ์ƒ๊ฐ์ธ๋ฐ ์ข€๋” ๊ณ ๋ฏผ์ด ํ•„์š”ํ•ด ๋ณด์ž…๋‹ˆ๋‹ค.
์™ ๋งŒํ•˜๋ฉด ์™ธ๋ถ€์—์„œ ๊ธฐ๋Šฅ ๊ตฌํ˜„์„ ๋งก๊ธฐ๋Š”๊ฒŒ ์ข‹๋‹ค๊ณ  ์ƒ๊ฐํ•ฉ๋‹ˆ๋‹ค. (๊ตฌํ˜„ํ•ด์•ผํ•  ๋“œ๋กญ๋‹ค์šด ํŒจํ„ด์ด ๊ต‰์žฅํžˆ ๋งŽ์Šต๋‹ˆ๋‹ค. ์˜ˆ) ์ปฌ๋Ÿฌ๋ฐ•์Šค, ํ…์ŠคํŠธ์ž…๋ ฅ, ๋ฒ„ํŠผ..)

ํ˜„์žฌ๋Š” ๋ณด์ด๊ธฐ/์ˆจ๊น€ ๊ธฐ๋Šฅ์ด ๋‹ค ์„ž์—ฌ์žˆ์–ด BaseColorPicker ํด๋ž˜์Šค ์ •๋ฆฌ๋ฅผ ์šฐ์„ ์œผ๋กœ ์ง„ํ–‰ํ•˜๊ณ  ์ถ”๊ฐ€ ๊ธฐ๋Šฅ์„ ๊ณ ๋ฏผํ•ด๋ด์•ผํ• ๊ฑฐ ๊ฐ™์Šต๋‹ˆ๋‹ค.

RGBA์— ์Šฌ๋ผ์ด๋”์ถ”๊ฐ€

ํ˜„์žฌ ์ปฌ๋Ÿฌํ”ผ์ปค์— ๊ฐœ๋ณ„ ์ˆ˜์น˜ ์กฐ์ •์—๋Š” ์Šฌ๋ผ์ด๋”๊ฐ€ ์—†์–ด ๋งˆ์šฐ์Šค์™€ ํ‚ค๋ณด๋“œ๋ฅผ ์˜ค๊ฐ€์•ผํ•จ
image
์ด ์œ„์น˜์—
image
์ด๋Ÿฐ ์Šฌ๋ผ์ด๋” ํ‘œ์‹œ ๋ฒ„ํŠผ์ด ์ถ”๊ฐ€๋˜์–ด ํด๋ฆญ์‹œ ๋ณผ๋ฅจ์กฐ์ •๊ธฐ์™€ ๋น„์Šทํ•œ
image
์Šฌ๋ผ์ด๋”๋ฅผ ํ†ตํ•ด ์กฐ์ ˆํ•  ์ˆ˜ ์žˆ๋Š” ๊ธฐ๋Šฅ ์ถ”๊ฐ€ ์š”๋ง

Add/Remove colorstops

I'm using this package in Angular and it does work for the most part. However adding/removing colorstops does not work (Version 1.10.5)

Adding a colorstop on the very left does work, however it seems to be quite buggy.
image

Adding one in between to existing stops will throw an error:
image
image

Nonetheless, thanks for your great work!

์ปฌ๋Ÿฌํ”ผ์ปค์—์„œ ํ•„์š”์—†๋Š” ํ•จ์ˆ˜๋“ค ์ œ๊ฑฐ (image, gl filter)

์ปฌ๋Ÿฌํ”ผ์ปค์—์„œ ์ง์ ‘์ ์œผ๋กœ ์‚ฌ์šฉํ•˜์ง€ ์•Š๋Š” ํ•จ์ˆ˜๋Š” ๋ชจ๋‘ ์ œ๊ฑฐ ํ•˜๊ณ  ๋ณ„๋„์˜ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๋กœ ๋งŒ๋“ค ์˜ˆ์ •์ž…๋‹ˆ๋‹ค.

@easylogic/image-filter
@easylogic/gl-filter

Code does not match documentation

Hi,
thanks for creating this repo. I'm trying to make it work in an Angular application, but it seems the documentation is not correct (anymore). Specifically, I'm trying to use the gradient picker. Could you give me a hint on how it should work as standalone (not CodeMirror)?

To Reproduce

import { Component, ElementRef } from "@angular/core"
import "@easylogic/colorpicker/dist/EasyLogicColorPicker.css"
import EasyLogicColorPicker from "@easylogic/colorpicker"

@Component({
  selector: "tt-gradient-picker",
  templateUrl: "./gradient-picker.component.html"
})
export class GradientPickerComponent {
  private readonly containerElem: any
  private gradientPicker: any

  public constructor(private readonly elem: ElementRef) {
    this.containerElem = this.elem.nativeElement.querySelector("#gradient-picker-container")
    console.log("containerElem", this.containerElem)
    this.initPicker()
  }

  private initPicker(): void {
    this.gradientPicker = new EasyLogicColorPicker.createGradientPicker({
      position: "inline",
      container: this.containerElem,
      type: "chromedevtool",
      colorpickerOptions: {
        type: "chromedevtool"
      },
      gradient: "linear-gradient(to right, red 0%, white 100%)",
      onChange: (gradientString: string, gradientObject: any): void => {
        console.log("change", gradientString, gradientObject)
      }
    })
  }
}

Expected behavior
All imports should be found, no errors displayed

Actual behavior
ERROR in ./node_modules/@easylogic/colorpicker/src/colorpicker/index.js Module not found: Error: Can't resolve '~/colorpicker/theme/circle' in '/mnt/c/WS-xxx/Code/Editor/packages/editor/node_modules/@easylogic/colorpicker/src/colorpicker' ERROR in ./node_modules/@easylogic/colorpicker/src/colorpicker/index.js Module not found: Error: Can't resolve '~/colorpicker/theme/default' in '/mnt/c/WS-xxx/Code/Editor/packages/editor/node_modules/@easylogic/colorpicker/src/colorpicker' ERROR in ./node_modules/@easylogic/colorpicker/src/colorpicker/index.js Module not found: Error: Can't resolve '~/colorpicker/theme/mini' in '/mnt/c/WS-xxx/Code/Editor/packages/editor/node_modules/@easylogic/colorpicker/src/colorpicker' ERROR in ./node_modules/@easylogic/colorpicker/src/colorpicker/index.js Module not found: Error: Can't resolve '~/colorpicker/theme/none' in '/mnt/c/WS-xxx/Code/Editor/packages/editor/node_modules/@easylogic/colorpicker/src/colorpicker' ERROR in ./node_modules/@easylogic/colorpicker/src/colorpicker/index.js Module not found: Error: Can't resolve '~/colorpicker/theme/ring' in '/mnt/c/WS-xxx/Code/Editor/packages/editor/node_modules/@easylogic/colorpicker/src/colorpicker'

Any help is greatly appreciated!

์ปฌ๋Ÿฌ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ ๋ณ€๊ฒฝ

์ปฌ๋Ÿฌ ๊ด€๋ จ๋œ ํ•จ์ˆ˜๋ฅผ @easylogic/color ๋กœ ์ฝ”๋“œ๋ฅผ ๋ถ„๋ฆฌํ•ด๋†“์€ ์ƒํƒœ๋ผ

๋‚ด๋ถ€ ์ปฌ๋Ÿฌ ์ฝ”๋“œ๋ฅผ ์ด ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๋กœ ๋Œ€์ฒดํ•ฉ๋‹ˆ๋‹ค.

Uncaught TypeError: Event.checkNumberKey is not a function

Describe the bug
Event.checkNumberKey is used in

checkNumberKey(e) {
return Event.checkNumberKey(e);
}
checkNotNumberKey(e) {
return !Event.checkNumberKey(e);
}
but there is no checkNumberKey function in Event.js

To Reproduce
Steps to reproduce the behavior:

  1. Open a color picker.
  2. Enter some value in the hex color area.
  3. Got error.

Expected behavior
I found a similar code https://github.com/easylogic/codemirror-colorpicker/blob/master/addon/colorpicker/colorpicker.js#L814-L825 but not sure it can be used as same as here.

Error log

colorpicker.js:6877 Uncaught TypeError: Event.checkNumberKey is not a function
    at ColorInformation.checkNumberKey (colorpicker.js:6877)
    at ColorInformation.keydown$hexCode (colorpicker.js:6964)
    at HTMLInputElement.<anonymous> (colorpicker.js:5402)

Desktop (please complete the following information):

  • OS: macOS 13
  • Browser: Chrome
  • Version: 76.0.3809.100 (Official Build) (64-bit)

css error

Hi , thank you for your hard work!
I follow the document but get wrong result, maybe something with css is wrong.
Snip20210408_14

์•„์ด๋“œ๋กœํผ ๊ธฐ๋Šฅ์ถ”๊ฐ€

https://developer.chrome.com/blog/new-in-chrome-95/?fbclid=IwAR0ABgTdRLlIsOSnRqfySK0aoD9a1z2owq0gcEsiBZqBsv3rzAut71UhBfQ#eyedropper

ํฌ๋กฌ์—์„œ ์ƒ‰๊น”์„ ์ถ”์ถœํ•˜๋Š” ๊ธฐ๋Šฅ์ด ๋‚˜์™”๋Š”๋ฐ ๊ธฐ๋Šฅ์„ ์ปฌ๋Ÿฌํ”ผ์ปค์— ์ง‘์–ด๋„ฃ์ž๋Š” ์–˜๊ธฐ๊ฐ€ ๋‚˜์™€์„œ ์ด์Šˆ๋กœ ์˜ฌ๋ฆฝ๋‹ˆ๋‹ค.

UI์—์„œ ์‚ดํŽด๋ณด๋‹ˆ ์ปฌ๋Ÿฌ ์Šฌ๋ผ์ด๋” ์™ผ์ชฝ ์˜์—ญ์— ๋ฒ„ํŠผ์œผ๋กœ ๋„ฃ์œผ๋ฉด ๋ ๊ฑฐ ๊ฐ™์Šต๋‹ˆ๋‹ค.
๋„ฃ์œผ๋ฉด์„œ ๊ฐ„๊ฒฉ๊ณผ ํฌ๊ธฐ๋ฅผ ์ค„์ด๋Š”๊ฒŒ ๋ถˆ๊ฐ€ํ”ผํ•ด ๋ณด์ž…๋‹ˆ๋‹ค.

๋จผ์ € @redgoose-dev ๊ฐ€ UI ๋ถ€๋ถ„์„ ์„ ํ–‰์ž‘์—…์„ ํ•˜๊ณ  @easylogic ๋‹˜์ด ์ปจํŠธ๋กค๋Ÿฌ ๋ถ€๋ถ„์„ ํ•˜๋ฉด ๋ ๊ฑฐ ๊ฐ™์Šต๋‹ˆ๋‹ค.


์ด ์ž‘์—…์„ ํ•˜๋ฉด์„œ ์ถ”๊ฐ€๋กœ useOpacity๋ผ๋Š” ์ด๋ฆ„์œผ๋กœ ์ด ๊ฐ’์ด true๋ผ๋ฉด ํˆฌ๋ช…๋„ ์กฐ์ ˆํ•˜๋Š” ์Šฌ๋ผ์ด๋“œ๊ฐ€ ๋…ธ์ถœ๋˜๋„๋ก ์ˆ˜์ •ํ•  ์˜ˆ์ •์ž…๋‹ˆ๋‹ค.

ERROR ReferenceError: isString is not defined

Describe the bug

When I try to run createGradientPicker with option 'gradient: 'conic-gradient(from 90deg at 50% 50%, white 0deg,black 360deg)' - In console error ERROR ReferenceError: isString is not defined.

To Reproduce

  1. Run
ColorPickerUI.createGradientPicker({
        position: "inline",
        container: document.querySelector('.test-elem'),
        gradient: 'conic-gradient(from 90deg at 50% 50%, white  0deg,black  360deg)',
      });

Expected behavior
Inited picker with correct gradient

Screenshots
Error in console
Screenshot 2022-01-19 at 14 40 28
Interface while error
Screenshot 2022-01-19 at 14 40 18

Desktop (please complete the following information):

  • OS: MacOS
  • Browser chrome
  • Version 97.0.4692.71

Additional context
String for gradient was generated by gradient picker. I can generate this gradient value without any error, but can't init picker with generated value. Error reproduce also with repeating-conic-gradient value.

how to use gradient picker in browser

hey there
I couldn't figure out how to initiate the gradient picker in browser. I'm not using any frameworks

this is my code

this.gradientPicker = new EasyLogicColorPicker({
  position: "inline",
  container: document.querySelector('#color-picker'),
  gradient: 'linear-gradient(to right, white 0%, black 100%)',
});

MacOS ํ™˜๊ฒฝ์—์„œ node-sass ์ธ์Šคํ†จ ๋ฌธ์ œ

  • MacOS: 11.4
  • node: 16.3.0
  • npm: 7.15.1

MacOS์—์„œ gyp ERR๋ จ ์˜ค๋ฅ˜๋กœ npm install์ด ์•ˆ๋˜๋Š” ํ˜„์ƒ์„ ๊ฒช๊ฒŒ ๋˜์—ˆ์Šต๋‹ˆ๋‹ค.


๋‹ค์Œ๊ณผ ๊ฐ™์€ ๋ฐฉ์‹์œผ๋กœ ์ธ์Šคํ†จ๊ณผ ๊ฐœ๋ฐœํ™”๋ฉด๊นŒ์ง€ ์—ฌ๋Š”๋ฐ ์„ฑ๊ณตํ–ˆ์Šต๋‹ˆ๋‹ค.

  1. package.json์˜ ๋””ํŽœ๋”์‹œ ํ•ญ๋ชฉ์—์„œ "rollup-plugin-scss": "^0.4.0", ์‚ญ์ œํ•ฉ๋‹ˆ๋‹ค. (์ธ์Šคํ†จ์‹œ ์˜ค๋ฅ˜๊ฐ€ ๋‚˜์„œ ๋ง‰ํžˆ๊ธฐ ๋•Œ๋ฌธ์— ์ฝ”๋“œ๋กœ ์‚ญ์ œํ•ฉ๋‹ˆ๋‹ค.)
  2. npm install๋กœ ์ธ์Šคํ†จ์€ ์„ฑ๊ณตํ•ฉ๋‹ˆ๋‹ค.
  3. npm install -d node-sass๋ฅผ ์‹คํ–‰ํ•˜์—ฌ ์ตœ์‹ ๋ฒ„์ „์œผ๋กœ ํŒจํ‚ค์ง€ ์ถ”๊ฐ€ํ•ฉ๋‹ˆ๋‹ค.
  4. npm run dev ์‹คํ–‰ํ•˜์—ฌ ๊ฐœ๋ฐœํ™”๋ฉด์„ ํ™•์ธํ•ฉ๋‹ˆ๋‹ค.

์ด์ฏค์œผ๋กœ ๋นŒ๋“œ๊นŒ์ง€ ๋˜๋Š”๊ฑธ ํ™•์ธํ–ˆ์Šต๋‹ˆ๋‹ค.
๋น„์Šทํ•œ ์ƒํ™ฉ์„ ๊ฒช๋Š”๋ถ„์ด ์žˆ์„๊นŒ๋ด ์ž‘์„ฑํ•ด๋‘ก๋‹ˆ๋‹ค.

[Violation] Added non-passive event listener to a scroll-blocking 'touchstart' event.

Describe the bug
[Violation] Added non-passive event listener to a scroll-blocking 'touchstart' event. Consider marking event handler as 'passive' to make the page more responsive. was printed a lot from colorpicker.js.

To Reproduce
Turn on verbose on the browser console and see warnings.

Screenshots
Screen Shot 2019-09-10 at 6 36 30 PM

Desktop (please complete the following information):

  • OS: macOS
  • Browser: Chrome
  • Version: 76.0.3809.132 (Official Build) (64-bit)

Additional context
XRef: https://www.chromestatus.com/feature/5745543795965952
XRef: https://developers.google.com/web/tools/lighthouse/audits/passive-event-listeners?hl=ko

Wrong color after three clicks

Describe the bug
Gradient color picker - After third click in the same place on color steps - one of color #NaNNaNNaN and all gradient is broken after that.

To Reproduce

  1. Click on color step panel three times in the same place
  2. Look at gradient string linear-gradient(90deg, white 0%, #NaNNaNNaN 46.330275229357795%,#898989 46.330275229357795% 46.330275229357795%,black 100%)

Expected behavior
Gradient has plus three selected steps

Screenshots
Screenshot 2022-01-18 at 23 22 59

Desktop (please complete the following information):

  • OS: MacOS
  • Browser chrome
  • Version 97.0.4692.71

Additional context
Firstly i found this error in npm package , I installed it in my angular application and this error reproduce even after second click. Then i tried to install development application, and there was error after third click. Also I noticed that npm package and develop version has different UI, is it ok? especially I can't see "Offset connected " checkbox in development app, only text. Also weird that I can't reproduce error on demo site

Gradient Picker onLastUpdate callback

Is your feature request related to a problem? Please describe.
The onLastUpdate callback doesn't working on Gradient Picker.

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

GradientPicker ์ฝ”๋“œ ๋ถ„๋ฆฌ

colorpicker ๋‚ด๋ถ€์— ๊ฐ™์ด ์กด์žฌํ•˜๋Š” GradientPicker ๋ฅผ ๋ถ„๋ฆฌํ•ฉ๋‹ˆ๋‹ค.

gradientpicker ์—์„œ colorpicker ๋ฅผ ์‚ฌ์šฉํ•˜๋Š” ๊ฐœ๋…์„ ๋‹ค์‹œ ๊ตฌ์„ฑํ•ฉ๋‹ˆ๋‹ค.

@easylogic/gradientpicker

ํ”„๋กœ์ ํŠธ๋กœ ๊ด€๋ จ์ฝ”๋“œ๋Š” ์˜ฎ๊ฒจ์งˆ ์˜ˆ์ •์ž…๋‹ˆ๋‹ค.

์ปฌ๋Ÿฌํ”ผ์ปค ์ธ์Šคํ„ด์Šค ๊ฐ์ฒด๋กœ ๋งŒ๋“œ๋Š” ๋ฐฉ์‹์— ๋Œ€ํ•˜์—ฌ..

ํ˜„์žฌ ์ปฌ๋Ÿฌํ”ผ์ปค๊ฐ€ ๋‘๊ฐ€์ง€ ๋ฐฉ์‹์œผ๋กœ ์ปดํฌ๋„ŒํŠธ๋ฅผ ๋งŒ๋“ค์–ด์„œ ์‚ฌ์šฉํ•˜๋Š”๊ฒƒ์œผ๋กœ ๋ณด์ž…๋‹ˆ๋‹ค.

๋ฐฉ๋ฒ•1)

import ColorPickerUI from '@easylogic/colorpicker';
const colorPicker = ColorPickerUI.create({
  ...
});

๋ฐฉ๋ฒ•2)

import { ColorPicker } from '@easylogic/colorpicker';
const colorPicker = new ColorPicker({
  ...
});

์ด๋Ÿฐ ๋ฐฉ์‹์ธ๋ฐ ์‚ฌ์šฉํ•˜๋Š” ๋ฐฉ์‹์„ ๋‹จ์ˆœํ™” ์‹œํ‚ค๋Š”๊ฒŒ ์ข‹์„๊ฑฐ ๊ฐ™์Šต๋‹ˆ๋‹ค.
๋‹จ์ˆœํ™” ์‹œํ‚ค๊ฒŒ ๋˜๋ฉด src/index.js์ด๋ž‘ src/colorpicker/index.js ํŒŒ์ผ๋“ค์„ ๋‹จ์ˆœํ™” ์‹œํ‚ฌ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

๋ฐฉ๋ฒ•2 ๋ฐฉ์‹์œผ๋กœ ์ปดํฌ๋„ŒํŠธ ํ•œ๊ฐœ๋กœ ํ•ฉ์น˜๋ฉด ์‚ฌ์šฉ๋ฒ•๋„ ๋‹จ์ˆœํ™”ํ•  ์ˆ˜ ์žˆ์„๊ฑฐ ๊ฐ™์Šต๋‹ˆ๋‹ค.

๊ทธ๋ฆฌ๊ณ  util ๋ถ€๋ถ„์˜ ํ•จ์ˆ˜๋“ค๋„ ๊ณต๊ฐœ๋กœ ๋…ธ์ถœ๋˜์–ด์žˆ๋Š”๋ฐ ๋…ธ์ถœ์‹œํ‚ฌ ํ•„์š”๊ฐ€ ์—†์–ด ๋ณด์ด๊ธด ํ•ฉ๋‹ˆ๋‹ค. ์šฉ๋„์— ์˜ํ•œ ์ง‘์ค‘์„ ํ•˜๋Š”๊ฒƒ์ด ์ข‹์ง€ ์•Š์„๊นŒ์š”.. util์— ๋“ค์–ด์žˆ๋Š” ์ปฌ๋Ÿฌ ํ•จ์ˆ˜๋“ค์€ ๋ณ„๋„์˜ ํ”„๋กœ์ ํŠธ๋กœ ๋ถ„๋ฆฌ ์‹œ์ผœ์„œ ๊ทธ ์šฉ๋„๋กœ๋งŒ ์‚ฌ์šฉํ•˜๋Š”๊ฒŒ ๊ฐœ์ธ์ ์œผ๋กœ ์ข‹์•„ ๋ณด์ž…๋‹ˆ๋‹ค.

์˜๊ฒฌ ๋ถ€ํƒ๋“œ๋ฆฝ๋‹ˆ๋‹ค. :)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.