updated colors

This commit is contained in:
2025-09-11 08:40:16 +02:00
parent 55a8067be6
commit c421dd0fe7
3 changed files with 70 additions and 16 deletions

View File

@@ -18,6 +18,20 @@ type Config struct {
LogLevel string `yaml:"log_level"`
TelnetServer bool `yaml:"telnetserver"`
FlexRadioSpot bool `yaml:"flexradiospot"`
SpotColorNewEntity string `yaml:"spot_color_new_entity"`
BackgroundColorNewEntity string `yaml:"background_color_new_entity"`
SpotColorNewBand string `yaml:"spot_color_new_band"`
BackgroundColorNewBand string `yaml:"background_color_new_band"`
SpotColorNewMode string `yaml:"spot_color_new_mode"`
BackgroundColorNewMode string `yaml:"background_color_new_mode"`
SpotColorNewBandMode string `yaml:"spot_color_new_band_mode"`
BackgroundColorNewBandMode string `yaml:"background_color_new_band_mode"`
SpotColorNewSlot string `yaml:"spot_color_new_slot"`
BackgroundColorNewSlot string `yaml:"background_color_new_slot"`
SpotColorMyCallsign string `yaml:"spot_color_my_callsign"`
BackgroundColorMyCallsign string `yaml:"background_color_my_callsign"`
SpotColorWorked string `yaml:"spot_color_worked"`
BackgroundColorWorked string `yaml:"background_color_worked"`
} `yaml:"general"`
Database struct {

View File

@@ -5,6 +5,21 @@ general:
log_level: DEBUG # INFO or DEBUG or WARN
telnetserver: true # not in use for now
flexradiospot: true # not in use for now
# Spot colors, if empty then default, colors in HEX AARRGGBB format
spot_color_new_entity:
background_color_new_entity:
spot_color_new_band:
background_color_new_band:
spot_color_new_mode:
background_color_new_mode:
spot_color_new_band_mode:
background_color_new_band_mode:
spot_color_new_slot:
background_color_new_slot:
spot_color_my_callsign:
background_color_my_callsign:
spot_color_worked:
background_color_worked:
database:
mysql: false #only one of the two can be true
sqlite: true

View File

@@ -175,29 +175,54 @@ func (fc *FlexClient) SendSpottoFlex(spot TelnetSpot) {
// If new DXCC
if spot.NewDXCC {
flexSpot.Color = "#ff3bf908"
flexSpot.Priority = "1"
flexSpot.BackgroundColor = "#ff000000"
flexSpot.Comment = flexSpot.Comment + " [New DXCC]"
} else if spot.DX == Cfg.General.Callsign {
flexSpot.Color = "#ffff0000"
flexSpot.Priority = "1"
if Cfg.General.SpotColorNewEntity != "" && Cfg.General.BackgroundColorNewEntity != "" {
flexSpot.Color = Cfg.General.SpotColorNewEntity
flexSpot.BackgroundColor = Cfg.General.BackgroundColorNewEntity
} else {
flexSpot.Color = "#ff3bf908"
flexSpot.BackgroundColor = "#ff000000"
}
} else if spot.DX == Cfg.General.Callsign {
flexSpot.Priority = "1"
if Cfg.General.SpotColorMyCallsign != "" && Cfg.General.BackgroundColorMyCallsign != "" {
flexSpot.Color = Cfg.General.SpotColorMyCallsign
flexSpot.BackgroundColor = Cfg.General.BackgroundColorMyCallsign
} else {
flexSpot.Color = "#ffff0000"
flexSpot.BackgroundColor = "#ff000000"
}
} else if spot.CallsignWorked {
flexSpot.Color = "#ffeaeaea"
flexSpot.BackgroundColor = "#ff00c0c0"
flexSpot.Priority = "5"
flexSpot.Comment = flexSpot.Comment + " [Worked]"
if Cfg.General.SpotColorWorked != "" && Cfg.General.BackgroundColorWorked != "" {
flexSpot.Color = Cfg.General.SpotColorWorked
flexSpot.BackgroundColor = Cfg.General.BackgroundColorWorked
} else {
flexSpot.Color = "#ff000000" //#ffeaeaea
flexSpot.BackgroundColor = "#ff00c0c0"
}
} else if spot.NewMode && spot.NewBand {
flexSpot.Color = "#ffc603fc"
flexSpot.Priority = "1"
flexSpot.BackgroundColor = "#ff000000"
flexSpot.Comment = flexSpot.Comment + " [New Band & Mode]"
} else if spot.NewMode && !spot.NewBand {
flexSpot.Color = "#fff9a908"
flexSpot.Priority = "2"
if Cfg.General.SpotColorNewBandMode != "" && Cfg.General.BackgroundColorNewBandMode != "" {
flexSpot.Color = Cfg.General.SpotColorNewBandMode
flexSpot.BackgroundColor = Cfg.General.BackgroundColorNewBandMode
} else {
flexSpot.Color = "#ffc603fc"
flexSpot.BackgroundColor = "#ff000000"
}
} else if spot.NewMode && !spot.NewBand {
flexSpot.Priority = "2"
flexSpot.Comment = flexSpot.Comment + " [New Mode]"
if Cfg.General.SpotColorNewMode != "" && Cfg.General.BackgroundColorNewMode != "" {
flexSpot.Color = Cfg.General.SpotColorNewMode
flexSpot.BackgroundColor = Cfg.General.BackgroundColorNewMode
} else {
flexSpot.Color = "#fff9a908"
flexSpot.BackgroundColor = "#ff000000"
}
} else if spot.NewBand && !spot.NewMode {
flexSpot.Color = "#fff9f508"
flexSpot.Priority = "3"