Use hsluv for display names & remove hsl funcs

This commit is contained in:
miruka 2019-08-21 12:38:01 -04:00
parent 9332eadbbf
commit 206f5494c8
2 changed files with 4 additions and 16 deletions

View File

@ -10,18 +10,6 @@ function hsluv(hue, saturation, lightness, alpha=1.0) {
} }
function hsl(hue, saturation, lightness) {
return hsla(hue, saturation, lightness)
}
function hsla(hue, saturation, lightness, alpha=1.0) {
// Convert standard hsla(0-360, 1-100, 1-100, 0-1) to Qt format
hue = numberWrapAround(hue, 360)
return Qt.hsla(hue / 360, saturation / 100, lightness / 100, alpha)
}
function hueFrom(string) { function hueFrom(string) {
// Calculate and return a unique hue between 0 and 360 for the string // Calculate and return a unique hue between 0 and 360 for the string
let hue = 0 let hue = 0
@ -33,7 +21,7 @@ function hueFrom(string) {
function nameColor(name) { function nameColor(name) {
return hsl( return hsluv(
hueFrom(name), hueFrom(name),
theme.controls.displayName.saturation, theme.controls.displayName.saturation,
theme.controls.displayName.lightness, theme.controls.displayName.lightness,

View File

@ -134,13 +134,13 @@ controls:
real opacity: 1.0 real opacity: 1.0
letter: letter:
int saturation: colors.saturation * 1.5 int saturation: 10 + colors.saturation * 1.5
int lightness: colors.intensity * 60 int lightness: colors.intensity * 60
real opacity: 1.0 real opacity: 1.0
displayName: displayName:
int saturation: colors.saturation int saturation: colors.saturation + 25
int lightness: Math.min(55, colors.intensity * 55) int lightness: Math.min(60, colors.intensity * 60)
// Special UI parts // Special UI parts