javascript

    Metaprogramming

    02 Dec, 2023public

    Class in JS

    05 Dec, 2023public

    Promises

    13 Nov, 2023public

    Js notes

    11 Jan, 2024public

    Iteration in javascript

    15 Nov, 2023public
    economics

    Incentive

    21 Aug, 2023public
    demo

    Demo

    13 Nov, 2023public
    personal

    Teaching myself CS

    05 Dec, 2023public

    People

    12 Dec, 2023public

    Links

    25 Mar, 2024public
    computer graphics

    Computer graphics from scratch

    12 Dec, 2023public
    notag

    Flexbox practice

    14 Aug, 2024public
    Lying in wait, set to pounce on the blank page,are letters up to no good,clutches of clauses so subordinatethey'll never let her get away.
    - The Joy Of Writing, Wislawa Szymborska

    Computer graphics from scratch

    .12 Dec, 2023

    Notes written while going through computer graphics from scratch.

    A bit of color theory

    Subtractive mode

    I've always viewed coloring a paper as putting something on the paper. Actually you are taking something off of the paper.

    1. Paper is initially white, which means it's reflecting lights of all wavelengths back into your eyes

    2. When you draw with a “yellow” crayon, you’re adding a layer of a material that absorbs some wavelengths but lets others pass through it. They’re reflected by the paper, pass through the yellow layer again, hit your eyes, and your brain interprets that particular combination of wavelengths as “yellow.”

    3. Since putting each layer of crayon is "taking away" some number of waves hitting our eyes, all the layers when put on top of each other end up in black. They let no wave pass through. Any combination of two crayons produces a darker variant than the either two colors.

    hello

    Additive mode

    But when putting colors on a screen, we are adding something to the screen. A paper merely reflects light. A screen emanates it. Therefore rgb(255,255,255) produces white.


    Table of contents
    A bit of color theory
    Subtractive mode
    Additive mode
    Abhimanyu