Skip to content
This repository was archived by the owner on Nov 27, 2018. It is now read-only.

Conversation

@albatrocity
Copy link

Hey Lakshan! Thanks for this nice little plugin.

I modified it to accept an array of objects for colors so that you can specify a color name instead of for friendlier output:

  var namedColors = [
      {name: "Hot Pink", hex: "cb3398"},
      {name: "Red", hex: "cc0001"},
      {name: "Orange", hex: "fe6500"},
      {name: "Powder", hex: "32ccfe"},
      {name: "Soft Pink", hex: "fe98ca"},
      {name: "Navy Blue", hex: "010066"},
      {name: "Yellow", hex: "ffcc00"},
      {name: "Black", hex: "000000"},
      {name: "Purple", hex: "c2aeeb"},
      {name: "Green", hex: "006500"}
  ]

  $('#color3').colorPicker({colors: namedColors});

The names show up in the palette and are passed into the onColorChange function.

Not sure how useful this is to anyone else, but I needed it for a project and thought I'd share.

Cheers!
Ross

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant