summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjaseg <git@jaseg.net>2020-12-25 15:38:30 +0100
committerjaseg <git@jaseg.net>2020-12-25 15:38:30 +0100
commite6103e70bea8e228a6318c1c67f89e406be7c409 (patch)
tree7ae9cfbcf0bb60cc62389235f4606430c31650a2
parenta924f2a5238bc0a124739c48d9d6408862de7164 (diff)
downloadlolcat-e6103e70bea8e228a6318c1c67f89e406be7c409.tar.gz
lolcat-e6103e70bea8e228a6318c1c67f89e406be7c409.tar.bz2
lolcat-e6103e70bea8e228a6318c1c67f89e406be7c409.zip
Add random support for rgb mode
-rwxr-xr-xlolcat.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lolcat.c b/lolcat.c
index 0fcd912..449abcc 100755
--- a/lolcat.c
+++ b/lolcat.c
@@ -196,7 +196,7 @@ int main(int argc, char** argv)
} else {
if (rgb) {
i += wcwidth(c);
- float theta = i * freq_h / 5.0f + l * freq_v + offx * M_PI;
+ float theta = i * freq_h / 5.0f + l * freq_v + (offx + 2.0f * rand_offset / RAND_MAX) * M_PI;
float offset = 0.1;
uint8_t red = lrintf((offset + (1.0f - offset) * (0.5f + 0.5f * sin(theta + 0 ))) * 255.0f);