Add random support for rgb mode
This commit is contained in:
parent
a924f2a523
commit
e6103e70be
1 changed files with 1 additions and 1 deletions
2
lolcat.c
2
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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue