shihn.ca ⚡️

👋🏽 Hi, I'm Preet. I write code for a living, and for fun. I focus mostly on the fun parts on this website. Here are some of my recent blog posts 👇

Resizing Rotated Elements
Visual editors usually allow resizing and rotation of elements. Applying both transforms can be a little tricky. Here's how to do it.
Need for Seed: Taming Randomness in a Pseudorandom World
When to used a seeded pseudorandom number generator, and things to consider you do.
How to emulate hand-drawn shapes / Algorithms behind RoughJS
A dive into graphics algorithms used in RoughJS.
Reducing Colors In An Image ⇢ Dithering
Explore how dithering can help adopt different color palettes, while maintaining the essence of the image.
Basic rasterization / Draw with emojis
Discovering basic algorithms to render lines, shapes, curves, and filling them.

And sometimes I make things. Here are some recent creations 👇