Skip to content

Instantly share code, notes, and snippets.

View gnull's full-sized avatar
💭
I moved from Github to Sourcehut and suggest you do the same

Ivan Oleynikov gnull

💭
I moved from Github to Sourcehut and suggest you do the same
View GitHub Profile
@gnull
gnull / lolcat.hs
Created May 27, 2017 13:34 — forked from shiroginne/lolcat.hs
simple lolcat powered by haskell
import Data.Word
freq = 0.3
spread = 8.0
unbase :: Integral int => int -> Word8 -> Word8 -> Word8 -> int
unbase base r g b = (fi r*base+fi g)*base+fi b
where fi = fromIntegral
-- | Approximate a 24-bit Rgb colour with a colour in the xterm256 6x6x6 colour cube, returning its index.