diff options
author | bptato <nincsnevem662@gmail.com> | 2022-12-12 18:26:06 +0100 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2022-12-12 18:36:17 +0100 |
commit | 77512303946a27d4f9b9ffc30f0aeb6c31f59e1c (patch) | |
tree | 5cc177ef52a3ad2c6f4e8757bbf547fb9deeb223 /src/config | |
parent | 96824ecd8f66eeedcf8bd954b44ddb32c50c9256 (diff) | |
download | chawan-77512303946a27d4f9b9ffc30f0aeb6c31f59e1c.tar.gz |
Fix color contrast correction
Instead of just inverting the color and hoping for the best, convert it to YUV and increase/decrease luminance based on results.
Diffstat (limited to 'src/config')
-rw-r--r-- | src/config/config.nim | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/config/config.nim b/src/config/config.nim index 3144b6fa..cb42d6af 100644 --- a/src/config/config.nim +++ b/src/config/config.nim @@ -41,7 +41,7 @@ type formatmode*: Option[FormatMode] noformatmode*: FormatMode altscreen*: Option[bool] - mincontrast*: float + mincontrast*: int editor*: string tmpdir*: string siteconf: seq[StaticSiteConfig] @@ -220,10 +220,7 @@ proc parseConfig(config: Config, dir: string, t: TomlValue) = of "double-width-ambiguous": config.ambiguous_double = v.b of "minimum-contrast": - if v.vt == VALUE_INTEGER: - config.mincontrast = float(v.i) - else: - config.mincontrast = float(v.f) + config.mincontrast = int(v.i) of "force-clear": config.forceclear = v.b of "emulate-overline": config.emulateoverline = v.b of "external": |