angular-minicolors icon indicating copy to clipboard operation
angular-minicolors copied to clipboard

add support for angular opacity and rgba scope bindings, to work with op...

Open JonathanMatthey opened this issue 9 years ago • 4 comments

...acity minicolors picker - bump to 0.0.7

Hi Kai,

this is an update that binds scope variables to the rgba and opacity values that are set when you use minicolors with {opacity:true}.
in your version 0.0.6, all you can get out of it is the HEX value, now you can get both the rgba(155,155,23,0.5) and the opacity value, or either.

I've also updated the gh-pages branch with a demo if you want to check it out.

Thanks, Jon

JonathanMatthey avatar Mar 25 '15 04:03 JonathanMatthey

@kaihenzler You still alive buddy ?

JonathanMatthey avatar Apr 02 '15 19:04 JonathanMatthey

Hey there, I was in vacation. Sorry for Not responding. I will take a look at your PR tomorrow. I'm Not sure if i like that you added 2 more Attribute or if we should use the ng-model to represent the color value including the opacity... I will think about it and tell you about it in this thread. Thanks a Lot that you like this directive And you did contribute to it!

Kind regards, Kai

kaihenzler avatar Apr 02 '15 20:04 kaihenzler

I thought about it and I think we should go the way you implemented the new features.

I pushed a commit in the development branch. I changed the prefix of the attribute names from 'ng' to 'minicolors'. Would you mind checking out the development branch and take a look at it?

The new Usage would be:

<input minicolors="opacitysettings"
  minicolors-rgba="color.opacityRgba"
  minicolors-opacity="color.opacityVal"
  ng-model="color.opacityHex">

Thanks, Kai

kaihenzler avatar Apr 03 '15 17:04 kaihenzler

I tried out this change. I wanted 2-way binding on my model, an RGBA string. Looks like you're still required to bind the hex value to a model, and you cannot set the input's value from an RGBA string; RGBA is a read-only value.

laurence-myers avatar Jun 09 '15 06:06 laurence-myers