//rgb 8 bits
int r = 255, g = 255, b = 255;
//sRGB (r', g' et b')
double rp = 0.0, gp = 0.0, bp = 0.0;
//L
double luma = 0.0;
convertir ici la couleur de fond, peu importe la méthode et la source, et stocker les composantes RGB (valeurs entières sur 8 bits, donc de 0 à 255 pour chaque composante) dans r, g et b.
//Rec.709
//luma = 0.2126 * r + 0.7152 * g + 0.0722 * b;
//Rec.601
//luma = 0.299 * r + 0.587 * g + 0.114 * b;
//Relative luminance from sRGB
//https://www.w3.org/TR/WCAG20/relative-luminance.xml
rp = r / 255.0;
gp = g / 255.0;
bp = b / 255.0;
if (rp <= 0.03928) rp = rp / 12.92; else rp = Math.Pow((rp + 0.055) / 1.055, 2.4);
if (gp <= 0.03928) gp = gp / 12.92; else gp = Math.Pow((gp + 0.055) / 1.055, 2.4);
if (bp <= 0.03928) bp = bp / 12.92; else bp = Math.Pow((bp + 0.055) / 1.055, 2.4);
luma = (0.2126 * rp) + (0.7152 * gp) + (0.0722 * bp);
//http://www.w3.org/TR/WCAG20/#contrast-ratiodef
return luma > 0.179 ? "#000000" : "#ffffff";
À noter :
Avec Rec.2020 :
luma = 0.2627 * r + 0.678 * g + 0.0593 * b
À noter aussi :
Pour plus d'infos : https://www.itu.int/rec/R-REC-BT.2020-2-201510-I/en
Blue Screen of Death Color Codes: HEX, RGB, and CMYK. Find hex, RGB and CMYK color values of some favorite shades of Blue Screen of Death.
BLUE SCREEN OF DEATH
HEX COLOR: #0827F5;
RGB: (8,39,245)
CMYK: (97,84,0,4)
Shades and Variations of Blue Screen of Death:
Complementary Colors to Blue Screen of Death:
A triadic color scheme offers the right amount of everything, be it contrast, color, richness, or harmony. Let's read in detail about these color combinations.