• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Line By Line

Dragon Drop

It's amazing what can be done with pure arithmetic. For example, let's take the conversion of colors from HSL (Hue, Saturation, Luminescence) to RGB (Red, Green, Blue). It's usually expressed in the form of algebraic equations, like this:

HSL and HSV - Wikipedia

But years ago, when these things were new, and there were no such formulas available (or at any rate I had never seen any), I experimented with Microsoft Paint by putting in HSL values and observing what the corresponding RGB values were. From the numbers I figured out for myself the "hexagon" model that Paint used; and then, just for fun -- using no algebra, and based on the numbers alone -- I worked out a series of purely arithmetical steps that would accomplish the conversion, and wrote them in the form of a document with line–by–line instructions like a tax return. It's hardly an efficient way to convert, but it shows how much you can do with no algebra, no square roots, no sines and cosines, no logarithms. If you needed to write an HSL–to–RGB values conversion program using a language that can't do any math except "adding, subbing, multing, and divving," you could do it by programming the steps on this document.


My Computer

System One

  • OS
    64-bit Windows 8
    System Manufacturer/Model
    HP 23-D030

Users Who Are Viewing This Thread (Users: 0, Guests: 1)