Skip to content

use allowEmpty at showPaletteOnly#545

Open
Ji-yeonPark wants to merge 3 commits into
bgrins:masterfrom
Ji-yeonPark:emptypalette
Open

use allowEmpty at showPaletteOnly#545
Ji-yeonPark wants to merge 3 commits into
bgrins:masterfrom
Ji-yeonPark:emptypalette

Conversation

@Ji-yeonPark

Copy link
Copy Markdown

Hi there.

There was solution for this function at #473 , but that was not work for me.
so, I fixed small error about "showPaletteOnly & allowEmpty".

✈️ HOW TO USE -1
This code can use allowEmpty option at "showPaletteOnly : true".

  • set allowEmpty to true
  • Put the '' at palette where you want it.
$("#shadow").spectrum({
        showPaletteOnly: true,
        allowEmpty: true,
        palette: [
            ['', 'black', 'white'],
            ['green', 'blue', 'yellow']
        ]
})

✈️ RESULT

image

✈️ HOW TO USE -2
it can be used "allowEmpty" option normally.

  • set allowEmpty to true
$("#shadow").spectrum({
        allowEmpty: true,
        color: "#ff0000",
})

✈️ RESULT

image

Fixed allowEmpty error.
W004: 'c' is already defined.
W033: Missing semicolon.
W041: Use '===' to compare with ''.
W041: Use '===' to compare with ''.
W033: Missing semicolon.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant