Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I make one pixel change its color in HTML?

Tags:

html

pixel

colors

let's say I have some given coordinates x and y for a pixel, how could I make it red (keeping everything else on the page just white) in HTML? Is it possible in HTML?

like image 763
brilliant Avatar asked Apr 11 '10 00:04

brilliant


People also ask

How do you set the color in pixels?

Once your phone finishes rebooting, you will find the new colors in Settings –> Display –> Styles & Wallpaper. Select "Custom 1" and choose a font and icon style. When you get to colors, you will see the new set of colors you flashed.

Can a pixel create any Colour?

In this way, specifying the brightness 0.. 255 for the red, blue, and green color components of the pixel, any color can be formed.

How do you add a custom color in HTML?

To add background color in HTML, use the CSS background-color property. Set it to the color name or code you want and place it inside a style attribute. Then add this style attribute to an HTML element, like a table, heading, div, or span tag.


1 Answers

<div style="position: absolute; left: {X}px; top: {Y}px; width: 1px; height: 1px; background-color: red;"></div>

Replace {X} and {Y} with the real coordinates you have. Might need to mess with z-index, depending on the page. Using position: fixed will let you position it relative to the browser, rather than the document.

like image 91
bcherry Avatar answered Nov 15 '22 03:11

bcherry