From caf4c54d76f59d3aab0bc1c9c9a1bafc29cd3890 Mon Sep 17 00:00:00 2001 From: Ceda EI Date: Fri, 9 Mar 2018 10:31:55 +0530 Subject: [PATCH] Added rgba function. Updated README --- README.md | 2 ++ lark.js | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/README.md b/README.md index 415dfef..de8bc86 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,4 @@ # Lark Firefox addon that fixes input boxes on dark themes. + +Lark checks for the background and foreground of each input box and calculates the contrast between them. If the contrast is below a certain value, it changes the background to black or white whichever has more contrast with the foreground than the required threshold. If neither white nor black scores more than the threshold with the foreground color, then both the background and foreground are changed to black and white respectively. diff --git a/lark.js b/lark.js index 599a5dd..cf14ff0 100644 --- a/lark.js +++ b/lark.js @@ -39,6 +39,10 @@ function rgb(r, g, b) { return [r, g, b] } +function rgba(r, g, b, a) { + return [r, g, b] +} + const blackLum = 0 const black = '#000000'; const whiteLum = 1