bevy14: upgrade Color::hex usage

This commit is contained in:
yuni 2024-07-09 02:38:28 +02:00
parent 18760e43c8
commit b038468cfc
2 changed files with 20 additions and 20 deletions

View file

@ -609,8 +609,8 @@ pub fn load_defs(mut ew_spawn: EventWriter<SpawnEvent>) {
}
["light", color_hex, brightness] => {
if let Ok(brightness_float) = brightness.parse::<f32>() {
if let Ok(color) = Color::hex(color_hex) {
state.light_color = Some(color);
if let Ok(color) = Srgba::hex(color_hex) {
state.light_color = Some(Color::Srgba(color));
state.light_brightness = brightness_float;
} else {
error!("Can't parse hexadecimal color code: {line}");

View file

@ -204,24 +204,24 @@ impl Default for Settings {
font_size_achievement_header: 32.0,
font_size_keybindings: 20.0,
font_size_version: 20.0,
hud_color: Color::hex(COLOR_PRIMARY).unwrap(),
hud_color_fps: Color::hex("#181818").unwrap(),
hud_color_console: Color::hex(COLOR_PRIMARY).unwrap(),
hud_color_console_achievement: Color::hex(COLOR_SUCCESS).unwrap(),
hud_color_console_warn: Color::hex(COLOR_WARNING).unwrap(),
hud_color_console_system: Color::hex(COLOR_SECONDARY).unwrap(),
hud_color_alert: Color::hex(COLOR_SECONDARY).unwrap(),
hud_color_subtitles: Color::hex(COLOR_SECONDARY).unwrap(),
hud_color_choices: Color::hex(COLOR_BODY).unwrap(),
hud_color_speedometer: Color::hex(COLOR_PRIMARY).unwrap(),
hud_color_deathpoem: Color::hex("#CC2200").unwrap(),
hud_color_achievement: Color::hex(COLOR_DIM).unwrap(),
hud_color_achievement_accomplished: Color::hex(COLOR_SUCCESS).unwrap(),
hud_color_achievement_header: Color::hex(COLOR_PRIMARY).unwrap(),
hud_color_death: Color::hex(COLOR_SECONDARY).unwrap(),
hud_color_death_achievements: Color::hex(COLOR_SECONDARY).unwrap(),
hud_color_keybindings: Color::hex(COLOR_DIM).unwrap(),
hud_color_version: Color::hex(COLOR_PRIMARY).unwrap(),
hud_color: Srgba::hex(COLOR_PRIMARY).unwrap().into(),
hud_color_fps: Srgba::hex("#181818").unwrap().into(),
hud_color_console: Srgba::hex(COLOR_PRIMARY).unwrap().into(),
hud_color_console_achievement: Srgba::hex(COLOR_SUCCESS).unwrap().into(),
hud_color_console_warn: Srgba::hex(COLOR_WARNING).unwrap().into(),
hud_color_console_system: Srgba::hex(COLOR_SECONDARY).unwrap().into(),
hud_color_alert: Srgba::hex(COLOR_SECONDARY).unwrap().into(),
hud_color_subtitles: Srgba::hex(COLOR_SECONDARY).unwrap().into(),
hud_color_choices: Srgba::hex(COLOR_BODY).unwrap().into(),
hud_color_speedometer: Srgba::hex(COLOR_PRIMARY).unwrap().into(),
hud_color_deathpoem: Srgba::hex("#CC2200").unwrap().into(),
hud_color_achievement: Srgba::hex(COLOR_DIM).unwrap().into(),
hud_color_achievement_accomplished: Srgba::hex(COLOR_SUCCESS).unwrap().into(),
hud_color_achievement_header: Srgba::hex(COLOR_PRIMARY).unwrap().into(),
hud_color_death: Srgba::hex(COLOR_SECONDARY).unwrap().into(),
hud_color_death_achievements: Srgba::hex(COLOR_SECONDARY).unwrap().into(),
hud_color_keybindings: Srgba::hex(COLOR_DIM).unwrap().into(),
hud_color_version: Srgba::hex(COLOR_PRIMARY).unwrap().into(),
chat_speed: DEFAULT_CHAT_SPEED * if dev_mode { 2.5 } else { 1.0 },
ar_avatar: 0,
flashlight_active: false,