+
{renderAuthor()}
{renderGenericFile()}
{renderPayment()}
diff --git a/ts/services/backups/export.ts b/ts/services/backups/export.ts
index 5a957ab65..7c6740fcf 100644
--- a/ts/services/backups/export.ts
+++ b/ts/services/backups/export.ts
@@ -141,6 +141,7 @@ import { migrateAllMessages } from '../../messages/migrateMessageData';
import { trimBody } from '../../util/longAttachment';
import { generateBackupsSubscriberData } from '../../util/backupSubscriptionData';
import { getEnvironment, isTestEnvironment } from '../../environment';
+import { calculateLightness } from '../../util/getHSL';
const MAX_CONCURRENCY = 10;
@@ -2784,10 +2785,14 @@ function checkServiceIdEquivalence(
function desktopHslToRgbInt(
hue: number,
saturation: number,
- lightness = 1
+ lightness?: number
): number {
// Desktop stores saturation not as 0.123 (0 to 1.0) but 12.3 (percentage)
- return hslToRGBInt(hue, saturation / 100, lightness);
+ return hslToRGBInt(
+ hue,
+ saturation / 100,
+ lightness ?? calculateLightness(hue)
+ );
}
function toGroupCallStateProto(state: CallStatus): Backups.GroupCall.State {
diff --git a/ts/util/getCustomColorStyle.ts b/ts/util/getCustomColorStyle.ts
index eeaaef7cc..3a7df966a 100644
--- a/ts/util/getCustomColorStyle.ts
+++ b/ts/util/getCustomColorStyle.ts
@@ -7,7 +7,7 @@ import { getHSL } from './getHSL';
import { getUserTheme } from '../shims/getUserTheme';
type ExtraQuotePropsType = {
- borderLeftColor?: string;
+ borderInlineStartColor?: string;
};
type BackgroundPropertyType =
@@ -18,7 +18,7 @@ type BackgroundPropertyType =
export function getCustomColorStyle(
color?: CustomColorType,
isQuote = false
-): BackgroundPropertyType {
+): (BackgroundPropertyType & ExtraQuotePropsType) | undefined {
if (!color) {
return undefined;
}
@@ -33,7 +33,7 @@ export function getCustomColorStyle(
if (theme === ThemeType.dark) {
adjustedLightness = -0.4;
}
- extraQuoteProps.borderLeftColor = getHSL(color.start);
+ extraQuoteProps.borderInlineStartColor = getHSL(color.start);
}
if (!color.end) {
diff --git a/ts/util/getHSL.ts b/ts/util/getHSL.ts
index fc35d4325..92bffd8bf 100644
--- a/ts/util/getHSL.ts
+++ b/ts/util/getHSL.ts
@@ -18,7 +18,7 @@ function getLightnessFromHue(hue: number, min: number, max: number) {
return (percentage * (maxValue - minValue)) / 100 + minValue;
}
-function calculateLightness(hue: number): number {
+export function calculateLightness(hue: number): number {
let lightness = 45;
if (hue < 60) {
lightness = getLightnessFromHue(hue, 0, 60);
@@ -55,7 +55,7 @@ export function getHSL(
adjustedLightness = 0
): string {
return `hsl(${hue}, ${saturation}%, ${
- lightness == null
+ lightness == null || adjustedLightness !== 0
? adjustLightnessValue(calculateLightness(hue), adjustedLightness)
: lightness * 100
}%)`;