HEX to RGB

HEX ke RGB adalah proses pengubahan suatu warna dari format kode warna HEX menjadi model warna RGB (singkatan dari Red, Green, Blue).

HEX to RGB is the process of converting a color from the HEX color code format to the RGB color model (which stands for Red, Green, Blue).

HEX Color Code:

A HEX color code is a 6-digit hexadecimal (base-16) representation of a color, typically preceded by a hash symbol (#). It consists of three pairs of characters, where each pair represents the Red, Green, and Blue components of the color. Each pair can have a value between 00 and FF (which is equivalent to 0-255 in decimal).

RGB Color Model:

In the RGB color model, each color is represented by three components:

  • Red (R): The intensity of the red color (value between 0 and 255),
  • Green (G): The intensity of the green color (value between 0 and 255),
  • Blue (B): The intensity of the blue color (value between 0 and 255).

How to Convert HEX to RGB:

  1. Remove the hash (#) symbol if it's included in the HEX code (e.g., #FF6347 becomes FF6347).
  2. Split the HEX code into three pairs of two characters:
    • The first pair represents the Red component,
    • The second pair represents the Green component,
    • The third pair represents the Blue component.
  3. Convert each HEX pair into decimal (base-10).

Example Conversion:

Let's convert #FF6347 (a HEX color code) to RGB.

  1. Remove the hash: #FF6347 becomes FF6347.

  2. Split into pairs:

    • Red: FF,
    • Green: 63,
    • Blue: 47.
  3. Convert each HEX pair to decimal:

    • FF in HEX → 255 in decimal (Red),
    • 63 in HEX → 99 in decimal (Green),
    • 47 in HEX → 71 in decimal (Blue).
  4. Resulting RGB color:
    #FF6347 in HEX = RGB(255, 99, 71).

Another Example:

Convert #00FF00 (pure green) to RGB.

  1. Remove the hash: #00FF00 becomes 00FF00.

  2. Split into pairs:

    • Red: 00,
    • Green: FF,
    • Blue: 00.
  3. Convert each HEX pair to decimal:

    • 00 in HEX → 0 in decimal (Red),
    • FF in HEX → 255 in decimal (Green),
    • 00 in HEX → 0 in decimal (Blue).
  4. Resulting RGB color:
    #00FF00 in HEX = RGB(0, 255, 0).

Summary:

  • HEX to RGB conversion allows you to transform a color from the HEX format (used in web design and digital art) into the RGB color model (used in screens and digital displays).
  • Example: #FF6347 converts to RGB(255, 99, 71).

Avatar

Codebee Co., Ltd.

Development Team

Nikmati hal-hal kecil dalam hidup. Untuk suatu hari, Anda mungkin melihat ke belakang dan menyadari bahwa itu adalah hal yang besar. Banyak kegagalan hidup yang disebabkan oleh orang-orang yang tidak menyadari betapa dekatnya mereka dengan kesuksesan ketika mereka menyerah.

Cookie
Kami peduli dengan data Anda dan ingin menggunakan cookie untuk meningkatkan pengalaman Anda.