Skip to content

Commit

Permalink
allow clear bg color
Browse files Browse the repository at this point in the history
  • Loading branch information
dmrschmidt committed Feb 14, 2017
1 parent 1d4ec25 commit a9d010c
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion DSWaveformImage.podspec
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "DSWaveformImage"
s.version = "5.0.0"
s.version = "5.0.1"
s.summary = "generate waveform images from audio files in iOS"
s.description = <<-DESC
DSWaveformImageDrawer and DSWaveformImageView generate waveform images of audio files.
Expand Down
6 changes: 3 additions & 3 deletions DSWaveformImage/DSWaveformImage/WaveformImageDrawer.swift
Expand Up @@ -21,7 +21,7 @@ public struct WaveformImageDrawer {
public func waveformImage(fromAudio audioAsset: AVURLAsset,
size: CGSize,
color: UIColor = UIColor.black,
backgroundColor: UIColor = UIColor.white,
backgroundColor: UIColor = UIColor.clear,
style: WaveformStyle = .gradient,
position: WaveformPosition = .middle,
scale: CGFloat = UIScreen.main.scale,
Expand All @@ -35,7 +35,7 @@ public struct WaveformImageDrawer {
public func waveformImage(fromAudioAt audioAssetURL: URL,
size: CGSize,
color: UIColor = UIColor.black,
backgroundColor: UIColor = UIColor.white,
backgroundColor: UIColor = UIColor.clear,
style: WaveformStyle = .gradient,
position: WaveformPosition = .middle,
scale: CGFloat = UIScreen.main.scale,
Expand All @@ -57,7 +57,7 @@ fileprivate extension WaveformImageDrawer {
}

private func graphImage(from samples: [Float], with configuration: WaveformConfiguration) -> UIImage? {
UIGraphicsBeginImageContextWithOptions(configuration.size, true, configuration.scale)
UIGraphicsBeginImageContextWithOptions(configuration.size, false, configuration.scale)
let context = UIGraphicsGetCurrentContext()!
context.setAllowsAntialiasing(true)
context.setShouldAntialias(true)
Expand Down
6 changes: 3 additions & 3 deletions DSWaveformImage/DSWaveformImage/WaveformImageTypes.swift
Expand Up @@ -32,7 +32,7 @@ public struct WaveformConfiguration {
/// Color of the waveform, defaults to black.
let color: UIColor

/// Background color of the waveform, defaults to white.
/// Background color of the waveform, defaults to clear.
let backgroundColor: UIColor

/// Waveform drawing style, defaults to .gradient.
Expand All @@ -49,13 +49,13 @@ public struct WaveformConfiguration {

public init(size: CGSize,
color: UIColor = UIColor.black,
backgroundColor: UIColor = UIColor.white,
backgroundColor: UIColor = UIColor.clear,
style: WaveformStyle = .gradient,
position: WaveformPosition = .middle,
scale: CGFloat = UIScreen.main.scale,
paddingFactor: CGFloat? = nil) {
self.color = color
self.backgroundColor = UIColor.white
self.backgroundColor = backgroundColor
self.style = style
self.position = position
self.size = size
Expand Down
2 changes: 1 addition & 1 deletion DSWaveformImage/Info.plist
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>4.1.0</string>
<string>5.0.1</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSPrincipalClass</key>
Expand Down
2 changes: 1 addition & 1 deletion DSWaveformImageExample/Info.plist
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>4.1.0</string>
<string>5.0.1</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSRequiresIPhoneOS</key>
Expand Down

0 comments on commit a9d010c

Please sign in to comment.