obf 0.6.8 → 0.6.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/tinycolor_convert.js +7 -2
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3772ad4028a2e7e780d943bfe384dacf59c17c9d
4
- data.tar.gz: 76fb2dc4d209f5ad9b1fbd94f22e2fe0c6937a16
3
+ metadata.gz: 91e5ddf2d4ec5f833258871d33b9c65c5bc7f59f
4
+ data.tar.gz: 83beff45b47d4e162c98f3206cef1ec5acdb3987
5
5
  SHA512:
6
- metadata.gz: 68f6499271a9b143c8c6e9b45752d5b1729e281e4b2d7bd17ffc544f0a0848cd1248e12976592523ab00c72e31a7e76210add30abba2504a92498b9e0584a174
7
- data.tar.gz: 672095044ab8a2ae7cf309393456135e9ae4de967caf16d11f66a268c5500708a3d9868b8657e72af82cd61b928f2831c0c67faa99208a4c02d56de1743b8072
6
+ metadata.gz: a9f46828444ffc612eb1c47421de17099ec0e9375bb769858e3395a77545f01e5e9a7387829639a266260dae1fa5adfb75c3489057d23893a29d344b272e69ad
7
+ data.tar.gz: ef488f0dad223baef6e063ec795ddd1793e19eab6e19b307e907d60678a983856d997c6fd691aaedf09dbd433d431554c402ea1a4f45b421192dbb6c3f678042
@@ -1122,8 +1122,13 @@ if(process.argv[3] == 'rgb') {
1122
1122
  console.log(color.toRgbString());
1123
1123
  } else {
1124
1124
  if(color.getAlpha() < 1.0) {
1125
- var brightness_factor = (255 - color.getBrightness()) / 255;
1126
- color = color.lighten(100 * brightness_factor * (1.0 - color.getAlpha()));
1125
+ var rgb = color.toRgb();
1126
+ var alpha_factor = 1.0 - color.getAlpha();
1127
+ var newrgb = {};
1128
+ newrgb.r = rgb.r + ((255 - rgb.r) * alpha_factor);
1129
+ newrgb.g = rgb.g + ((255 - rgb.g) * alpha_factor);
1130
+ newrgb.b = rgb.b + ((255 - rgb.b) * alpha_factor);
1131
+ color = tiny(newrgb);
1127
1132
  }
1128
1133
  console.log(color.toHex());
1129
1134
  }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: obf
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.8
4
+ version: 0.6.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Whitmer