Buscar herramientas...

Buscar herramientas...

Convertidor Hex a RGB

Convertir códigos de color hex a valores RGB al instante

rgb(59, 130, 246)
R: 59, G: 130, B: 246

How Convertidor Hex a RGB Works

A Hex to RGB Converter is a color translation utility used to turn Hexadecimal codes into Red-Green-Blue integers. This tool is essential for programmers and digital artists manipulating color channels programmatically, adapting web colors for print/desktop apps, and debugging CSS variables.

The conversion engine handles the math through a parsing pipeline:

  1. Cleaner: It removes the # symbol.
  2. Expansion: If the length is 3 (F00), it doublies each char (FF0000).
  3. Parsing: It slices the string into pairs (RR, GG, BB).
  4. Math: It parses each pair as a hex integer:
    • parseInt('FF', 16) = 255.
    • parseInt('00', 16) = 0.
  5. Output: rgb(255, 0, 0).

The History of Color Depth

Why are there 16.7 million colors?

  • 1 Byte per Channel: We use 8 bits for Red, 8 for Green, 8 for Blue.
  • 8 Bits = 256 values: $2^8 = 256$ (0-255).
  • The Total: $256 \times 256 \times 256 = 16,777,216$. This is "True Color."
  • Why Hex?: Hex fits 8 bits into exactly 2 characters. It is the perfect language for 8-bit Color.

Technical Comparison: When to use RGB

RGB isn't just for CSS.

Context Format Why?
Web (CSS) Hex Short
Javascript RGB Math / Animation
Java / C# RGB (Ints) Data Storage
Photoshop RGB Editing

By using this tool, you ensure your Color Math is accurate.

Security and Privacy Considerations

Your calculation is performed in a secure, local environment:

  • Local Logical Execution: All math is performed locally in your browser. Your design files never touch our servers.
  • Zero Log Policy: We do not store or track your inputs. Your Private UI Kits and Branding remain entirely confidential.
  • W3C Security Compliance: The tool operates within the standard browser sandbox, ensuring no interaction with your local file system or Private Metadata.
  • Privacy First: To maintain absolute Data Privacy, the tool functions as an anonymous utility.
  • Invalid Check: If you paste "Hello", the tool flags it as Not a Color.

How It's Tested

We provide a high-fidelity engine that is verified against Standard CSS Browsers.

  1. The "Short" Pass:
    • Action: Input #ABC.
    • Expected: Result rgb(170, 187, 204) (Expands to AABBCC).
  2. The "Case" Check:
    • Action: Input #ff00ff (Lowercase).
    • Expected: Result rgb(255, 0, 255) (Magenta).
  3. The "Invalid" Verification:
    • Action: Input #ZZZ.
    • Expected: Flags "Invalid Hex Color."
  4. The "Reverse" Defense:
    • Action: Convert -> Revert.
    • Expected: Returns the Original Hex.

Technical specifications and guides are available at the MDN CSS Color Guide, the W3C Color Standards, and the Britannica entry on Color Theory.

Frequently Asked Questions

It splits the Hex string into 3 pairs (Red, Green, Blue). Then it converts each pair from Base-16 to Base-10. FF = 255. 00 = 0.

Herramientas relacionadas