AudioKit / AudioKitUI

Controls and Visualization for AudioKit apps
MIT License
187 stars 52 forks source link

add backgroundColor variable to FFTView #33

Closed transat closed 2 years ago

transat commented 2 years ago

Adds an optional backgroundColor variable that defaults to black.

transat commented 2 years ago

It might make more sense to move the parameter to right after the linearGradient one but didn't want to risk upsetting existing code.

NickCulbertson commented 2 years ago

@transat Hello! Is changing backgroundColor working as intended? It seems like the Rectangle fill color might need to be set to backgroundColor and possibly the border too?

FFTView(conductor.osc, linearGradient: LinearGradient(gradient: Gradient(colors: [.yellow, .red, .green]), startPoint: .top, endPoint: .center), paddingFraction: 0.1, includeCaps: false, numberOfBars: 5, maxAmplitude: -90.0, minAmplitude: -150.0, backgroundColor: Color.red)

When running this the background remains black. Tested on Xcode 12.3

Edit: Oh, I think this was intended just to prevent color from bleeding from the background. I made an update (#37) so that backgroundColor changes the fill and borders colors too.

Thanks, Nick