mirror of
https://github.com/chatmail/core.git
synced 2026-05-07 17:06:35 +03:00
feat: slightly increase saturation of colors
It really depends on the screen, but on Android phones with higher DPI than laptop screen the contrast looks a bit too low. It should not be increased too high because of clipping.
This commit is contained in:
@@ -34,7 +34,7 @@ async fn test_chat_info() {
|
|||||||
"archived": false,
|
"archived": false,
|
||||||
"param": "",
|
"param": "",
|
||||||
"is_sending_locations": false,
|
"is_sending_locations": false,
|
||||||
"color": 29377,
|
"color": 29381,
|
||||||
"profile_image": {},
|
"profile_image": {},
|
||||||
"draft": "",
|
"draft": "",
|
||||||
"is_muted": false,
|
"is_muted": false,
|
||||||
@@ -1933,7 +1933,7 @@ async fn test_chat_get_color() -> Result<()> {
|
|||||||
let t = TestContext::new().await;
|
let t = TestContext::new().await;
|
||||||
let chat_id = create_group_ex(&t, None, "a chat").await?;
|
let chat_id = create_group_ex(&t, None, "a chat").await?;
|
||||||
let color1 = Chat::load_from_db(&t, chat_id).await?.get_color(&t).await?;
|
let color1 = Chat::load_from_db(&t, chat_id).await?.get_color(&t).await?;
|
||||||
assert_eq!(color1, 0x613dd7);
|
assert_eq!(color1, 0x6239dc);
|
||||||
|
|
||||||
// upper-/lowercase makes a difference for the colors, these are different groups
|
// upper-/lowercase makes a difference for the colors, these are different groups
|
||||||
// (in contrast to email addresses, where upper-/lowercase is ignored in practise)
|
// (in contrast to email addresses, where upper-/lowercase is ignored in practise)
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ fn rgb_to_u32(rgb: Rgb<u8>) -> u32 {
|
|||||||
/// Lightness is set to half (0.5) to make colors suitable both for light and dark theme.
|
/// Lightness is set to half (0.5) to make colors suitable both for light and dark theme.
|
||||||
pub fn str_to_color(s: &str) -> u32 {
|
pub fn str_to_color(s: &str) -> u32 {
|
||||||
let lightness = 0.5;
|
let lightness = 0.5;
|
||||||
let chroma = 0.22;
|
let chroma = 0.23;
|
||||||
let angle = str_to_angle(s);
|
let angle = str_to_angle(s);
|
||||||
let oklch = Oklch::new(lightness, chroma, angle);
|
let oklch = Oklch::new(lightness, chroma, angle);
|
||||||
let rgb = oklch.to_rgb(TransferFunction::Srgb);
|
let rgb = oklch.to_rgb(TransferFunction::Srgb);
|
||||||
|
|||||||
@@ -759,7 +759,7 @@ async fn test_contact_get_color() -> Result<()> {
|
|||||||
let t = TestContext::new().await;
|
let t = TestContext::new().await;
|
||||||
let contact_id = Contact::create(&t, "name", "name@example.net").await?;
|
let contact_id = Contact::create(&t, "name", "name@example.net").await?;
|
||||||
let color1 = Contact::get_by_id(&t, contact_id).await?.get_color();
|
let color1 = Contact::get_by_id(&t, contact_id).await?.get_color();
|
||||||
assert_eq!(color1, 0x4947dc);
|
assert_eq!(color1, 0x4844e2);
|
||||||
|
|
||||||
let t = TestContext::new().await;
|
let t = TestContext::new().await;
|
||||||
let contact_id = Contact::create(&t, "prename name", "name@example.net").await?;
|
let contact_id = Contact::create(&t, "prename name", "name@example.net").await?;
|
||||||
|
|||||||
Reference in New Issue
Block a user