obf 0.9.8.10 → 0.9.8.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/obf/external.rb +1 -1
- data/lib/obf/pdf.rb +4 -3
- data/lib/tinycolor_convert.js +2 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 46ac08afef61672a59703da2bc305d08bf293cbbebbe98a1a0b53db0a9344e9d
|
4
|
+
data.tar.gz: 6234bb16ab6c89a021d0754ad759955a0cb6709a808dd7e357475b45156d3c4b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 44c9c23805b78858c0018e818bedb6feebb1aebe2acef09518497595e83a3245ff7929de15734a5910a2f6b1458b9526652e38b7680847f5db738ff04fdadd08
|
7
|
+
data.tar.gz: 1fa32a4e2a6b7ee0a6a86caec469415e3b3552c5233117dc894673d9c1d41f63b8a03b24fd9a8ce5a2bfe2ea02b0aa5842d78bb322aba0b7dfbe856fd1aa4093
|
data/lib/obf/external.rb
CHANGED
@@ -122,7 +122,7 @@ module OBF::External
|
|
122
122
|
images.each do |img|
|
123
123
|
if path_hash && path_hash['images'] && path_hash['images'][img['id']]
|
124
124
|
elsif img['url'] && !img['data']
|
125
|
-
got_url = OBF::Utils.get_url(img['url'], true)
|
125
|
+
got_url = OBF::Utils.get_url(img['url'].to_s, true)
|
126
126
|
if got_url['request']
|
127
127
|
hydra.queue(got_url['request'])
|
128
128
|
grabs << {req: got_url['request'], img: img, res: got_url}
|
data/lib/obf/pdf.rb
CHANGED
@@ -255,10 +255,11 @@ module OBF::PDF
|
|
255
255
|
elsif options['text_case'] == 'lower'
|
256
256
|
text = text.downcase
|
257
257
|
end
|
258
|
+
text_color = OBF::Utils.fix_color(fill, 'contrast')
|
258
259
|
|
259
260
|
if options['text_only']
|
260
261
|
# render text
|
261
|
-
pdf.fill_color
|
262
|
+
pdf.fill_color text_color
|
262
263
|
pdf.text_box text, :at => [0, 0], :width => button_width, :height => button_height, :align => :center, :valign => :center, :overflow => :shrink_to_fit, :direction => direction
|
263
264
|
else
|
264
265
|
# render image
|
@@ -285,7 +286,7 @@ module OBF::PDF
|
|
285
286
|
pdf.fill_color "ffffff"
|
286
287
|
pdf.stroke_color "eeeeee"
|
287
288
|
pdf.fill_and_stroke_rounded_rectangle [button_width - 18, page_vertical], 20, text_height, 5
|
288
|
-
pdf.fill_color
|
289
|
+
pdf.fill_color text_color
|
289
290
|
text_options = {:text => page}
|
290
291
|
text_options[:anchor] = "page#{page}" if options['links']
|
291
292
|
pdf.formatted_text_box [text_options], :at => [button_width - 18, page_vertical], :width => 20, :height => text_height, :align => :center, :valign => :center
|
@@ -293,7 +294,7 @@ module OBF::PDF
|
|
293
294
|
end
|
294
295
|
|
295
296
|
# render text
|
296
|
-
pdf.fill_color
|
297
|
+
pdf.fill_color text_color
|
297
298
|
vertical = options['text_on_top'] ? button_height : text_height
|
298
299
|
pdf.text_box text, :at => [0, vertical], :width => button_width, :height => text_height, :align => :center, :valign => :center, :overflow => :shrink_to_fit, :direction => direction
|
299
300
|
end
|
data/lib/tinycolor_convert.js
CHANGED
@@ -1120,6 +1120,8 @@ else {
|
|
1120
1120
|
var color = tiny(process.argv[2]);
|
1121
1121
|
if(process.argv[3] == 'rgb') {
|
1122
1122
|
console.log(color.toRgbString());
|
1123
|
+
} else if(process.argv[3] == 'contrast') {
|
1124
|
+
console.log(tiny.mostReadable(color, ['#fff', '#000']).toHex());
|
1123
1125
|
} else {
|
1124
1126
|
if(color.getAlpha() < 1.0) {
|
1125
1127
|
var rgb = color.toRgb();
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: obf
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.8.
|
4
|
+
version: 0.9.8.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brian Whitmer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-01-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|