What is the actual 50% gray hex?

For everything that's not in any way related to PureBasic. General chat etc...
Olli
Addict
Addict
Posts: 1194
Joined: Wed May 27, 2020 12:26 pm

Re: What is the actual 50% gray hex?

Post by Olli »

reposting to Tawbie, I follow this. And that is for this, that I talked about cga standard (which is different to True colors ).

00h = black
55h = dark gray
AAh = gray
FFh = white

So, in this way, a 50% gray is half from 0AAh which is equal to 055h (dark gray). :mrgreen:

Note for AZJIO :

Code: Select all

dim x(7)
x(0) = $FFFFFF - $808080 ; is equal to...
x(1) = #White - $808080 ; which is also equal to...
x(2) = #White ! $808080

x(3) = #White ! $7F7F7F

x(4) = $000000
x(5) = $555555
x(6) = $AAAAAA
x(7) = $FFFFFF

For i = 0 To 7
 Debug Hex(x(i) ! $White)
Next
Here, we can see the gray true color inverting stays near a gray true color, but a gray cga color becomes a dark gray.

You could note that this 255/3 coefficient has a good ratio to find the brown colour : $AA5500 (rgb order) (CGA) compressable to %10 01 00 (6 bits rgb). Technically, the CGA displayer received the colours of each pixel bit per bit and that broke the eyes. If we cut the color code, this is presented like this : % iR iG iB. i is the intensity. There was also 4 wires between the graphic card and the monitor. This standard was named RGBI, and this really destroyed the eyes. Today, it just stays these 3 * 2 bits which compress the color datas of a pixel. And our displays are very speed. No black line between two blinding pixels, no screen horizontal lines which twinkles 15 times per seconds, and no scrolling which breaks the pictures of a graphic animation. We are very lucky today.

I think if the true colors are not linear, it is because the hardware must adapt the picture to the human eyes...
Tawbie
User
User
Posts: 35
Joined: Fri Jul 10, 2020 2:36 am
Location: Australia

Re: What is the actual 50% gray hex?

Post by Tawbie »

Hi Olli,
You cannot manipulate sRGB as if it scales linearly with light intensity, eg. taking 50% of an sRGB value.

Hi Everyone,
As I explained in my earlier post on this thread, the sRGB colorspace typically used in computer displays does NOT scale linearly with light intensity. This means that a value of sRGB(127,127,127) Is NOWHERE NEAR 50% light intensity as viewed on a computer monitor.

If you want to manipulate light intensity in a linear way, eg. 25%, 50%, etc... you MUST use "linear light" NOT sRGB. The conversion equations are well defined in the industry, eg. https://en.wikipedia.org/wiki/SRGB

On the other hand, if in this post 50% gray is referring to something else, then I have completely missed the point of es_91's original question and I apologise.
User avatar
Piero
Addict
Addict
Posts: 862
Joined: Sat Apr 29, 2023 6:04 pm
Location: Italy

Re: What is the actual 50% gray hex?

Post by Piero »

Mah…

AI Overview:
50% gray in the RGB color model is represented as rgb(128, 128, 128) or rgb(50%, 50%, 50%).
In a 8-bit color space, this is the midpoint between black (0, 0, 0) and white (255, 255, 255).

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

websafe No
CSS3 Color names
gray50
grey50
Hex #7f7f7f
RGB rgb(127,127,127)
RGB in % rgb(50%,50%,50%)
CMY in % C=50 M=50 Y=50
CMYK in % C=0 M=0 Y=0 K=50
HSL hsl(0,0%,50%)
HSV hsv(-,0%,50%)
Rec. 601 luma 127
Rec. 709 luma 127
Rec. 2020 luma 127
Complementary color #808080
Decimal 8355711
Olli
Addict
Addict
Posts: 1194
Joined: Wed May 27, 2020 12:26 pm

Re: What is the actual 50% gray hex?

Post by Olli »

@Tawbie

Thank you for the link about standard RGB. This tells a start in 1996. (a time where a video card memory reached 1MB)

Note it is difficult to talk about deep times in the past. The CGA standard is absolutely not an actual referency : it is just the first color video card on PC and started in 1981.

What I say, is the CGA standard, which was so ugly that lots of people should have wept their eyes, is now a good tip to coder of today.

1) You take a base : 255 / 3. Why 255 ? It is our actual standard in a color component. Why 3 ? Because if 3 parts, then 3+1 thresholds. Tip 3+1 = 4. And 4 matches to a 2-bits nibble.
Result 255 / 3 = 85

2) You want to dispose of all colors in a source code (in PureBasic) without staying execute a converter which gives you a 6-hex digit result. Example : I want yellow and I get FFFF00 from a color palette picker. It is cool and sophisticated but it is slow, typing "FFFF00" or "RGB($FF, $FF, $FF)" etc...

3) Retaking an old tip in an old standard of the 80's, no need to stop your coding to search a color code. Yellow is just 330.

4) A pixel is just represented by 3 digits between 0 and 3 and each digit is based on a 2-bits component.

5) If I want 4 pixels : yellow, magenta, brown, gray and blue, this is like that :

Code: Select all

DataSection
Data.s "330303210222002"
EndDataSection
I do not invent anything. This subject has inspired me to talk about an old tip, whom the video hardware physically does not break our eyes, as in the old computers in 40 years ago.

I did not complexified the text, talking about the transparency (alpha + RGB : 4 * 2 bits) which nests a transparent quasi-true color in just a 8-bits byte, and the HAM8 of the Amiga which could be integrated, being given that all the 63 colors indexed by the bits patterns %00xxxxxx are the same as 0 (full transparency).

It is just a tip, not a standard, however I consider a gray as a rgb(170,170,170). Good subject.
User avatar
Piero
Addict
Addict
Posts: 862
Joined: Sat Apr 29, 2023 6:04 pm
Location: Italy

Re: What is the actual 50% gray hex?

Post by Piero »

I worked for "paper printing" some years…
To make it simple: you need to see how it will look on paper, and it's impossible…
Best professionals I worked with (also in Brazil) were (scanner) ppl that just needed to see the CMYK values on photoshop (with PS, monitor and film printer needing just "a minimally decent color profile")……………………

Worst stuff (needs a LOT of experience): wood and food
es_91
Enthusiast
Enthusiast
Posts: 298
Joined: Thu Jan 27, 2011 12:00 pm
Location: DE

Re: What is the actual 50% gray hex?

Post by es_91 »

Despite the fact that Microsoft always used 128 and 191 for 4-shade gray support, the scale should better be:

0 (black)
$55555 (85, dark gray)
$AAAAAA (170, light gray)
$FFFFFF (255, white)
:mrgreen:
Olli
Addict
Addict
Posts: 1194
Joined: Wed May 27, 2020 12:26 pm

Re: What is the actual 50% gray hex?

Post by Olli »

es_91 wrote:$55555 (85, dark gray)
It misses a '5' digit ! So, we will say it's perfect... 0x 05 55 55 h... A light cyan gray standard because 55 / 2 = 5 in the new CPUs...
Post Reply