Log in

No account? Create an account
thoughts and feels and thoughts and feels
: :::::::..:. ..:::. .: ..:.:..:.

September 2009
    1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30

thoughts and feels and thoughts and feels [userpic]

Hardware has probably advanced to the point by now that I don't have to worry what hex numbers I pick for my journal scheme, right?



Most likely, they've become codified by name as well as hex, so if you can find an index of all 256(?) colors, you could do it that way.

They have - there's some "What Hex Color are You?" quiz out there that lists them all. Difficulty with that: LJ customisation fields only allow for a certain number of characters, and it's often not enough.

Anyway, it was my impression that 256 was what you came up with when you only used 0, 3, 6, 9, C, and F in your hex codes. I want them ALL.


Actually, the 0, 3, 4, 9, C, F is an artifact of the olden days of web browsing.

I remember when I was surfing the web in my Netscape 1.0 browser on a 256-color computer, and because of the number of colors that can be displayed, 256 (8-bit), is only a tiny fraction of what "true color" supports (24-bit, or over 16 million), there was a lot of "dithering" that went on--blending pixels of two different colors together to make them look like some intermediate color. This led to very dotty and grainy images.

But what colors were dithered and what colors were used to dither? Netscape decided to create a set of colors that were "browser-safe" and were never dithered. All other colors that were dithered were created from these colors. Since Netscape was the de-facto standard at the time, IE adopted this same set of "browser-safe" colors. Web developers of the day, in order to prevent grainy dithered images, had to use these colors as much as possible.

As people moved to 16-bit colors (65536 colors, which is still less than 16 million), this became less important, but since 16-bit was still not true color, there was still a bit of dithering going on, so many of the professional and/or tradiationalist (I fall into the traditionalist category) developers still used these "safe" colos (esp. since there was no longer any agree standard for what colors are safe in 16-bit color mode, and thus, these "safe" colors were still the only gauranteed safe colors).

It wasn't until large numbers of people started to use 24-bit true color that people finally started to not care and even forget about the "safe colors". Some traditionalist developers and large-audience developers (those who need to make as many customers happy, including those using legacy hardware) still use browser safe colors. I still try to whenever possible.

Anyway, the browser safe colors are officially defined as any color where the red, green, and blue components were multiples of 0x33. 0x33 * 4 = 0xCC. Anyway, there were thus 6 possible values for each of the 3 components (0x33 * 0 through 0x33 * 5), and 6 raised to the third power is 216. So the safe color set actually has 216 colors, not 256. The remaining 40 served as a buffer because things like the operating system used up some color space.

Yes, *that* was what I was asking about.

I was trying to visually recreate a color scheme I'd had before and enjoyed - was ending up (using a palette) with a bunch of wildly unsafe colors looking approximately correct.

However, have since found that color list, and it was all safe colors anyway - it's from fall 2001, when I was still in the habit of using them.

Haven't worked in 216 for quite some time, but if I remember correctly, the thing that frustrates me the most about it is the lack of anything orange.

What's the 0x in '0x33' mean? I understand it functionally, but not - actually (?).

It's some ISO, RFC, or IEEE standard. Don't remember which. Didn't know the story behind it until one of the ACM competitions, where one had to code something to work with these set of rules.

Anyway, the standard states that...
1/ By default, all numbers should be treated as decimal. So 1234 = 1234
2/ If a number starts with a "0", then it will NOT be treated as decimal.
3/ If the number starts with a "0" and just goes on, it is to be treated as octal. So 01234 = 668
4/ If the number starts with a "0" and is then followed by a "b", it is to be treated as binary ("b" for "binary"). So 0b10011010010 = 1234
5/ If the number starts with a "0" and is then followed by a "x", it is to be treated as hexadecimal ("x" for "heX"). So 0x1234 = 4660

And so that's where the "x" comes in. When programming, if you ever want the computer to interpret your input as octal or as hex, you have to use the special formatting. And in some languages, even "b" is recognzied. So for example, I can legally use this in a piece of code that I write.

for (int i = 0x4000; i < 0x100000; i += 0xC000)
// And I actually do write code like this quite often

Which would be a lot cleaner-looking and much more intuitive than using the decimal representations of 16384, 1048576, and 49152. For one, you can look at that and figure out in your head, fairly painlessly, how many times the loop will run (0x15 times). But if you were working with decimals, the mental math becomes much more icky 'cuz there ain't so many nice, round zeros trailing all the numbers. :)

Likewise, if you are using numbers as bitmasks or bitmaps where the value of the number isn't important, but which bits are turned on are, the 0b representation would be more intuitive. And octal... that ain't used that much. The most common place I know where octal is used is if you run Unix/Linux and are chmodding. A chmod command takes an octal input, like 0644.

Have you ever considered going into education?

But hex is so intuitive!

For one, my screenname would be a lot easier to type in hex:

Hex digits are certainly a lot easier for me to maniuplate than remembering what the difference is between "dark magenta" and "purple". :p

Just so long as I can see what they really look like in pretty quick order and tweak accordingly.

You have left the computer science major quite behind.

Me or code65536?

Did you look at E. 100th St. yet? [/nag]