refine drop shadows

This commit is contained in:
Andy Meneely
2021-07-23 11:27:04 -04:00
parent b25f0d535b
commit 9ea66021d3
3 changed files with 41 additions and 39 deletions
-20
View File
@@ -1,20 +0,0 @@
require 'squib'
orig = Cairo::ImageSurface.new(100,100)
orig_cc = Cairo::Context.new(orig)
orig_cc.circle(50,50, 30)
orig_cc.set_source_color(:red)
orig_cc.fill
orig.write_to_png '_output/blend_orig.png'
new_img = Cairo::ImageSurface.new(120, 120)
new_cc = Cairo::Context.new(new_img)
new_cc.set_source_color(:black)
new_cc.rectangle(0,0,120,120)
new_cc.fill
new_cc.set_source orig
new_cc.operator = :dest_in
new_cc.paint
new_img.write_to_png '_output/blend_new.png'
+1 -5
View File
@@ -1,5 +1,4 @@
require_relative '../../lib/squib'
# require 'squib'
require 'squib'
# The save_png method supports drop shadows on the final save
# This is useful for when you want to generate images for your rulebook
@@ -63,9 +62,6 @@ Squib::Deck.new(width:50, height: 50) do
# background defaults to fully transparent here
# star x: 50, y: 50, inner_radius: 15, outer_radius: 35,
# fill_color: :red, stroke_color: :red
png file: 'doodle.png'
# save_png prefix: 'no_bg_shadow_', shadow_radius: 8, shadow_offset_x: 3, shadow_offset_y: 3