diff options
author | June McEnroe <june@causal.agency> | 2018-10-02 14:19:54 -0400 |
---|---|---|
committer | June McEnroe <june@causal.agency> | 2018-10-02 14:23:47 -0400 |
commit | 05fa4de3e5180a1a9fb5e7893535ff8f2ba728a0 (patch) | |
tree | 455cd8d3b3f7fbd2c3a12008fc11aaa2bc4d2dcc /bin/fbatt.c | |
parent | Allow setting colors in psf2png (diff) | |
download | src-05fa4de3e5180a1a9fb5e7893535ff8f2ba728a0.tar.gz src-05fa4de3e5180a1a9fb5e7893535ff8f2ba728a0.zip |
Rewrite scheme
Diffstat (limited to '')
-rw-r--r-- | bin/fbatt.c | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/bin/fbatt.c b/bin/fbatt.c index c951cd21..4ae2aa02 100644 --- a/bin/fbatt.c +++ b/bin/fbatt.c @@ -35,12 +35,6 @@ static const uint32_t Right = 5 * 8 + 1; // fbclock width. static const uint32_t Width = 8; static const uint32_t Height = 16; -static const uint32_t BG = Scheme.darkBlack; -static const uint32_t Border = Scheme.darkWhite; -static const uint32_t Gray = Scheme.lightBlack; -static const uint32_t Yellow = Scheme.darkYellow; -static const uint32_t Red = Scheme.darkRed; - int main() { int error; @@ -108,20 +102,20 @@ int main() { uint32_t left = info.xres - Right - Width; for (uint32_t y = 0; y <= Height; ++y) { - buf[y * info.xres + left - 1] = Border; - buf[y * info.xres + left + Width] = Border; + buf[y * info.xres + left - 1] = DarkWhite; + buf[y * info.xres + left + Width] = DarkWhite; } for (uint32_t x = left; x < left + Width; ++x) { - buf[Height * info.xres + x] = Border; + buf[Height * info.xres + x] = DarkWhite; } for (uint32_t y = 0; y < Height; ++y) { for (uint32_t x = left; x < left + Width; ++x) { buf[y * info.xres + x] = - (Height - 1 - y > height) ? BG - : (percent <= 10) ? Red - : (percent <= 30) ? Yellow - : Gray; + (Height - 1 - y > height) ? DarkBlack + : (percent <= 10) ? DarkRed + : (percent <= 30) ? DarkYellow + : LightBlack; } } } |