This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function fixDarkMode() { | |
function rgb2lab(rgb) { | |
var r = rgb[0] / 255, | |
g = rgb[1] / 255, | |
b = rgb[2] / 255, | |
x, y, z; | |
r = (r > 0.04045) ? Math.pow((r + 0.055) / 1.055, 2.4) : r / 12.92; | |
g = (g > 0.04045) ? Math.pow((g + 0.055) / 1.055, 2.4) : g / 12.92; | |
b = (b > 0.04045) ? Math.pow((b + 0.055) / 1.055, 2.4) : b / 12.92; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ContentHandler from '../schema/ContentHandler'; | |
import { transformElementForDarkMode, AlteredElement } from 'owa-dark-mode-utilities'; | |
import { | |
ATTR_COLOR, | |
ATTR_BGCOLOR, | |
DATA_OG_STYLE_COLOR, | |
DATA_OG_ATTR_COLOR, | |
DATA_OG_STYLE_BACKGROUNDCOLOR, | |
DATA_OG_ATTR_BGCOLOR, | |
} from 'owa-content-colors'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function git_branch { | |
branch="`git branch 2>/dev/null | grep "^\*" | sed -e "s/^\*\ //"`" | |
if [ "${branch}" != "" ];then | |
if [ "${branch}" = "(no branch)" ];then | |
branch="(`git rev-parse --short HEAD`...)" | |
fi | |
echo " ($branch)" | |
fi | |
} |