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
Advanced Color Picker in Fyne2.0 show Black as using my customed theme's primary color which is set before. #1970
Comments
Please can you provide a minimal code that exhibits the error and that we can compile and run? |
Hi @andydotxyz, Here is the short code for more clear explanation of my question: package main
import (
"fyne.io/fyne/v2"
"fyne.io/fyne/v2/app"
"fyne.io/fyne/v2/container"
"fyne.io/fyne/v2/dialog"
"fyne.io/fyne/v2/theme"
"fyne.io/fyne/v2/widget"
"image/color"
)
type TestTheme struct {}
func (TestTheme) Color(a fyne.ThemeColorName, b fyne.ThemeVariant) color.Color {
if a == theme.ColorNamePrimary {
return color.RGBA{R: 100, G: 100, B: 100, A: 255}
}
return theme.DarkTheme().Color(a, b)
}
func (TestTheme) Font(a fyne.TextStyle) fyne.Resource {
return theme.DarkTheme().Font(a)
}
func (TestTheme) Icon(a fyne.ThemeIconName) fyne.Resource {
return theme.DarkTheme().Icon(a)
}
func (TestTheme) Size(a fyne.ThemeSizeName) float32 {
return theme.DarkTheme().Size(a)
}
func main() {
window := app.NewWithID("example").NewWindow("example")
settingMenu := fyne.NewMenu("Settings", fyne.NewMenuItem("Demo Code", func() {
SettingDialog("Demo", window)},
))
mainMenu := fyne.NewMainMenu(settingMenu)
window.SetMainMenu(mainMenu)
window.Resize(fyne.NewSize(800, 800))
fyne.CurrentApp().Settings().SetTheme(TestTheme{})
window.ShowAndRun()
}
func SettingDialog(tl string, win fyne.Window) {
//Advanced color picker
advButton := widget.NewButton( "Test", func() {
picker := dialog.NewColorPicker("Pick a Color", "Please pick your color:", func(color.Color) {
}, win)
picker.Advanced = true
picker.Show()
})
cusBox := container.NewVBox(advButton)
set := dialog.NewCustomConfirm(tl, "Apply", "Exit", cusBox, nil, win)
set.Show()
} |
Great, thanks - I can see the issue now |
It turns out to be an issue with our un-multiply-alpha code. |
Feel free to test that fix @apieceof :) |
Fixed in upcoming 2.0.1 |
Describe the bug:
Advanced Color Picker in Fyne2.0 won't show my customed theme's primary color which is set before.
To Reproduce:
Steps to reproduce the behaviour:
Screenshots:
Example code:
Device (please complete the following information):
The text was updated successfully, but these errors were encountered: