Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature/119-background #133

Merged
merged 1 commit into from
Jan 10, 2020
Merged

feature/119-background #133

merged 1 commit into from
Jan 10, 2020

Conversation

johnfercher
Copy link
Owner

@johnfercher johnfercher commented Jan 8, 2020

Description

  • Enable to set background color

Image
sample1-1

Using with Row

m := pdf.NewMaroto(consts.Portrait, consts.A4)

m.SetBackgroundColor(color.Color{
	Red:   190,
	Green: 190,
	Blue:  190,
})

m.Row(10, func() {
	m.Col(func() {
		// Add components
	})
	// May add another cols
})

m.SetBackgroundColor(color.NewWhite())

// Do more things and save

Using with TableList

m := pdf.NewMaroto(consts.Portrait, consts.A4)

header, contents := getSmallContent()
	
m.TableList(header, contents, props.TableList{
	AlternatedBackground: &color.Color{
		Red:   200,
		Green: 200,
		Blue:  200,
	},
})

// Do more things and save

Related Issue
resolves #119

Checklist

check with "x", if applied to your change

  • All methods associated with structs has func (s *struct) method() {} name style.
  • Wrote unit tests for new/changed features.
  • Updated docs/doc.go
  • Updated pkg/pdf/example_test.go
  • Updated README.md
  • Updated all examples inside internal/examples
  • New public methods has comments upside them explaining what it does
  • Executed go fmt github.com/johnfercher/maroto/... to format all files

@codecov-io
Copy link

codecov-io commented Jan 9, 2020

Codecov Report

Merging #133 into dev will increase coverage by 0.08%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##              dev     #133      +/-   ##
==========================================
+ Coverage   95.25%   95.32%   +0.08%     
==========================================
  Files           9        9              
  Lines         526      534       +8     
==========================================
+ Hits          501      509       +8     
  Misses         21       21              
  Partials        4        4
Impacted Files Coverage Δ
pkg/props/prop.go 100% <ø> (ø) ⬆️
internal/tablelist.go 58.34% <100%> (+2.98%) ⬆️
pkg/pdf/pdf.go 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d2999b6...2186fff. Read the comment docs.

@happsie
Copy link
Contributor

happsie commented Jan 9, 2020

this one is really nice 😄 👍

@johnfercher johnfercher merged commit a3d72ec into dev Jan 10, 2020
@johnfercher johnfercher deleted the feature/119-background branch January 10, 2020 00:04
@johnfercher johnfercher mentioned this pull request Jan 10, 2020
felix pushed a commit to felix/maroto that referenced this pull request May 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants