Compare commits

..

No commits in common. "9c952173f431ff1560ba165bac084f083ba4ba9e" and "cd9ed41d2d660a7dc41762756532925245bd32ac" have entirely different histories.

4 changed files with 12 additions and 18 deletions

View file

@ -6,6 +6,10 @@
color: var(--inputTopbarText, var(--inputText));
}
a {
color: var(--link);
}
.inner-nav {
display: grid;
grid-template-rows: var(--navbar-height);
@ -87,6 +91,10 @@
width: 2em;
height: 100%;
text-align: center;
.svg-inline--fa {
color: var(--link);
}
}
.sitename {

View file

@ -32,18 +32,6 @@ export default {
directives: {
textColor: '--text'
}
},
{
component: 'Icon',
parent: {
component: 'ButtonUnstyled',
parent: {
component: 'TopBar'
}
},
directives: {
textColor: '--parent--text'
}
}
]
}

View file

@ -225,7 +225,7 @@ export const getTextColor = function (bg, text, preserve) {
const originalColor = convert(text).hex
const invertedColor = invertLightness(originalColor).hex
const invertedContrast = getContrastRatio(bg, convert(invertedColor).rgb)
const invertedContrast = getContrastRatio(bg, invertedColor)
let workColor
if (invertedContrast > originalContrast) {
@ -238,14 +238,13 @@ export const getTextColor = function (bg, text, preserve) {
const result = convert(rgb2hex(workColor)).hsl
const delta = result.l > 50 ? 1 : -1
const multiplier = 10
while (contrast < 4.5 && result.l > 0 && result.l < 100) {
while (contrast < 4.5) {
result.l += delta * multiplier
contrast = getContrastRatio(bg, convert(result).rgb)
console.log(convert(result).hex, result.l, contrast)
contrast = getContrastRatio(bg, result)
}
const base = typeof text.a !== 'undefined' ? { a: text.a } : {}
return Object.assign(convert(result).rgb, base)
return Object.assign(base, result)
}
/**

View file

@ -56,7 +56,6 @@
"bg": "#323337",
"fg": "#1D1E21",
"link": "#18A0E3",
"accent": "#6671E2",
"text": "#DBDDE0",
"cRed": "#E05053",
"cBlue": "#6671E2",