feat: extract colors.

This commit is contained in:
Zhang Dian
2024-06-28 16:27:17 +08:00
parent 4e08c2a38d
commit 52845ebae8
3 changed files with 54 additions and 20 deletions

View File

@@ -5,8 +5,8 @@
xmlns:converters="clr-namespace:Ursa.Converters;assembly=Ursa">
<converters:DivideByTwoConverter x:Key="DivideByTwoConverter" />
<ControlTheme x:Key="{x:Type u:Avatar}" TargetType="{x:Type u:Avatar}">
<Setter Property="Foreground" Value="White" />
<Setter Property="Background" Value="{DynamicResource SemiGrey3}" />
<Setter Property="Foreground" Value="{DynamicResource AvatarForeground}" />
<Setter Property="Background" Value="{DynamicResource AvatarGreyBackground}" />
<Setter Property="FontSize" Value="20" />
<Setter Property="FontWeight" Value="Bold" />
<Setter Property="Width" Value="48" />
@@ -50,52 +50,52 @@
Converter={x:Static ObjectConverters.IsNotNull}}" />
</Style>
<Style Selector="^.Red">
<Setter Property="Background" Value="{DynamicResource SemiRed3}" />
<Setter Property="Background" Value="{DynamicResource AvatarRedBackground}" />
</Style>
<Style Selector="^.Pink">
<Setter Property="Background" Value="{DynamicResource SemiPink3}" />
<Setter Property="Background" Value="{DynamicResource AvatarPinkBackground}" />
</Style>
<Style Selector="^.Purple">
<Setter Property="Background" Value="{DynamicResource SemiPurple3}" />
<Setter Property="Background" Value="{DynamicResource AvatarPurpleBackground}" />
</Style>
<Style Selector="^.Violet">
<Setter Property="Background" Value="{DynamicResource SemiViolet3}" />
<Setter Property="Background" Value="{DynamicResource AvatarVioletBackground}" />
</Style>
<Style Selector="^.Indigo">
<Setter Property="Background" Value="{DynamicResource SemiIndigo3}" />
<Setter Property="Background" Value="{DynamicResource AvatarIndigoBackground}" />
</Style>
<Style Selector="^.Blue">
<Setter Property="Background" Value="{DynamicResource SemiBlue3}" />
<Setter Property="Background" Value="{DynamicResource AvatarBlueBackground}" />
</Style>
<Style Selector="^.LightBlue">
<Setter Property="Background" Value="{DynamicResource SemiLightBlue3}" />
<Setter Property="Background" Value="{DynamicResource AvatarLightBlueBackground}" />
</Style>
<Style Selector="^.Cyan">
<Setter Property="Background" Value="{DynamicResource SemiCyan3}" />
<Setter Property="Background" Value="{DynamicResource AvatarCyanBackground}" />
</Style>
<Style Selector="^.Teal">
<Setter Property="Background" Value="{DynamicResource SemiTeal3}" />
<Setter Property="Background" Value="{DynamicResource AvatarTealBackground}" />
</Style>
<Style Selector="^.Green">
<Setter Property="Background" Value="{DynamicResource SemiGreen3}" />
<Setter Property="Background" Value="{DynamicResource AvatarGreenBackground}" />
</Style>
<Style Selector="^.LightGreen">
<Setter Property="Background" Value="{DynamicResource SemiLightGreen3}" />
<Setter Property="Background" Value="{DynamicResource AvatarLightGreenBackground}" />
</Style>
<Style Selector="^.Lime">
<Setter Property="Background" Value="{DynamicResource SemiLime3}" />
<Setter Property="Background" Value="{DynamicResource AvatarLimeBackground}" />
</Style>
<Style Selector="^.Yellow">
<Setter Property="Background" Value="{DynamicResource SemiYellow3}" />
<Setter Property="Background" Value="{DynamicResource AvatarYellowBackground}" />
</Style>
<Style Selector="^.Amber">
<Setter Property="Background" Value="{DynamicResource SemiAmber3}" />
<Setter Property="Background" Value="{DynamicResource AvatarAmberBackground}" />
</Style>
<Style Selector="^.Orange">
<Setter Property="Background" Value="{DynamicResource SemiOrange3}" />
<Setter Property="Background" Value="{DynamicResource AvatarOrangeBackground}" />
</Style>
<Style Selector="^.Grey">
<Setter Property="Background" Value="{DynamicResource SemiGrey3}" />
<Setter Property="Background" Value="{DynamicResource AvatarGreyBackground}" />
</Style>
<Style Selector="^.Square">

View File

@@ -1,2 +1,19 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
</ResourceDictionary>
<SolidColorBrush x:Key="AvatarForeground" Color="White" />
<SolidColorBrush x:Key="AvatarRedBackground" Color="#D73324" />
<SolidColorBrush x:Key="AvatarPinkBackground" Color="#C72261" />
<SolidColorBrush x:Key="AvatarPurpleBackground" Color="#89289F" />
<SolidColorBrush x:Key="AvatarVioletBackground" Color="#6439B5" />
<SolidColorBrush x:Key="AvatarIndigoBackground" Color="#3444A3" />
<SolidColorBrush x:Key="AvatarBlueBackground" Color="#1D75DB" />
<SolidColorBrush x:Key="AvatarLightBlueBackground" Color="#0A81CC" />
<SolidColorBrush x:Key="AvatarCyanBackground" Color="#0E8999" />
<SolidColorBrush x:Key="AvatarTealBackground" Color="#0A9588" />
<SolidColorBrush x:Key="AvatarGreenBackground" Color="#32953D" />
<SolidColorBrush x:Key="AvatarLightGreenBackground" Color="#679934" />
<SolidColorBrush x:Key="AvatarLimeBackground" Color="#84B00C" />
<SolidColorBrush x:Key="AvatarYellowBackground" Color="#D2AF0F" />
<SolidColorBrush x:Key="AvatarAmberBackground" Color="#CA8F1E" />
<SolidColorBrush x:Key="AvatarOrangeBackground" Color="#D56F0F" />
<SolidColorBrush x:Key="AvatarGreyBackground" Color="#555B61" />
</ResourceDictionary>

View File

@@ -1,2 +1,19 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
</ResourceDictionary>
<SolidColorBrush x:Key="AvatarForeground" Color="White" />
<SolidColorBrush x:Key="AvatarRedBackground" Color="#FB9078" />
<SolidColorBrush x:Key="AvatarPinkBackground" Color="#F27396" />
<SolidColorBrush x:Key="AvatarPurpleBackground" Color="#C96FD1" />
<SolidColorBrush x:Key="AvatarVioletBackground" Color="#A67FDD" />
<SolidColorBrush x:Key="AvatarIndigoBackground" Color="#8090D3" />
<SolidColorBrush x:Key="AvatarBlueBackground" Color="#65B2FC" />
<SolidColorBrush x:Key="AvatarLightBlueBackground" Color="#62C3F5" />
<SolidColorBrush x:Key="AvatarCyanBackground" Color="#58CBD3" />
<SolidColorBrush x:Key="AvatarTealBackground" Color="#54D1C1" />
<SolidColorBrush x:Key="AvatarGreenBackground" Color="#7DD182" />
<SolidColorBrush x:Key="AvatarLightGreenBackground" Color="#ADD37E" />
<SolidColorBrush x:Key="AvatarLimeBackground" Color="#B7E35B" />
<SolidColorBrush x:Key="AvatarYellowBackground" Color="#FCE865" />
<SolidColorBrush x:Key="AvatarAmberBackground" Color="#F6D86F" />
<SolidColorBrush x:Key="AvatarOrangeBackground" Color="#FDC165" />
<SolidColorBrush x:Key="AvatarGreyBackground" Color="#A7ABB0" />
</ResourceDictionary>