diff --git a/src/main/kotlin/org/jetbrains/plugins/template/weatherApp/WeatherAppColors.kt b/src/main/kotlin/org/jetbrains/plugins/template/weatherApp/WeatherAppColors.kt new file mode 100644 index 0000000..4346803 --- /dev/null +++ b/src/main/kotlin/org/jetbrains/plugins/template/weatherApp/WeatherAppColors.kt @@ -0,0 +1,12 @@ +package org.jetbrains.plugins.template.weatherApp + +import androidx.compose.ui.graphics.Color + +object WeatherAppColors { + val nightWeatherColor = Color(0xFF1A237E) + val coldWeatherColor = Color(0xFF3F51B5) + val coolWeatherColor = Color(0xFF5E35B1) + val mildWeatherColor = Color(0xFF039BE5) + val warmWeatherColor = Color(0xFFFF9800) + val hotWeatherColor = Color(0xFFE91E63) +} \ No newline at end of file diff --git a/src/main/kotlin/org/jetbrains/plugins/template/weatherApp/ui/components/WeatherDetailsCard.kt b/src/main/kotlin/org/jetbrains/plugins/template/weatherApp/ui/components/WeatherDetailsCard.kt index 116700e..efe8d66 100644 --- a/src/main/kotlin/org/jetbrains/plugins/template/weatherApp/ui/components/WeatherDetailsCard.kt +++ b/src/main/kotlin/org/jetbrains/plugins/template/weatherApp/ui/components/WeatherDetailsCard.kt @@ -182,12 +182,12 @@ fun isNightTime(dateTime: LocalDateTime): Boolean { */ fun getCardColorByTemperature(temperature: Float, isNightTime: Boolean): Color { return when { - isNightTime -> Color(0xFF1A237E) // Dark blue for night - temperature < 0 -> Color(0xFF3F51B5) // Cold: blue - temperature < 10 -> Color(0xFF5E35B1) // Cool: purple - temperature < 20 -> Color(0xFF039BE5) // Mild: light blue - temperature < 30 -> Color(0xFFFF9800) // Warm: orange - else -> Color(0xFFE91E63) // Hot: pink/red + isNightTime -> WeatherAppColors.nightWeatherColor + temperature < 0 -> WeatherAppColors.coldWeatherColor + temperature < 10 -> WeatherAppColors.coolWeatherColor + temperature < 20 -> WeatherAppColors.mildWeatherColor + temperature < 30 -> WeatherAppColors.warmWeatherColor + else -> WeatherAppColors.hotWeatherColor } }