Tool to convert a color into a number and a number into a color (physical or numerical values) as wavelength, frequency, energy (eV), temperature (Kelvin), hue, RGB, HTML Hex code, 24-bit, Pantone, ANSI, CGA, etc.
Color in Number - dCode
Tag(s) : Physics-Chemistry, Informatics
dCode is free and its tools are a valuable help in games, maths, geocaching, puzzles and problems to solve every day!
A suggestion ? a feedback ? a bug ? an idea ? Write to dCode!
A visible color can have various numerical representations, whether physical (such as wavelength or photon energy), computer-based (such as RGB code, hexadecimal code, or ANSI/CGA standards), or for indexing purposes (Pantone color chart, etc.).
If the number is based on a computer value, the conversion can be straightforward: any color displayed on a screen is generally composed of three integers for red, green, and blue, encoded using 256 values.
Example: A 24-bit integer (3 times 8 bits) can represent any color for computer media. Color is often represented by a 6-digit hexadecimal code #abcdef (used in HTML)
If the number is based on a physical value, dCode will compare the color with its approximate physical representation.
dCode uses a colorimetric distance (Delta E) hue matching algorithm to suggest the closest color to a given color.
— Some numbers (such as Pantone color chart or Kelvin temperature) depend on the lighting context or the display medium.
— The visible spectrum is not linear, and digital models are limited to human trichromatic vision.
— Physical conversions (wavelength, frequency, electron volt) do not cover non-spectral colors (white, gray, black).
dCode retains ownership of the "Color in Number" source code. Any algorithm for the "Color in Number" algorithm, applet or snippet or script (converter, solver, encryption / decryption, encoding / decoding, ciphering / deciphering, breaker, translator), or any "Color in Number" functions (calculate, convert, solve, decrypt / encrypt, decipher / cipher, decode / encode, translate) written in any informatic language (Python, Java, PHP, C#, Javascript, Matlab, etc.) or any database download or API access for "Color in Number" or any other element are not public (except explicit open source licence like Creative Commons). Same with the download for offline use on PC, mobile, tablet, iPhone or Android app.
Reminder: dCode is an educational and teaching resource, accessible online for free and for everyone.
The content of the page "Color in Number" and its results may be freely copied and reused, including for commercial purposes, provided that dCode.fr is cited as the source.
Exporting the results is free and can be done simply by clicking on the export icons ⤓ (.csv or .txt format) or ⧉ (copy and paste).
To cite dCode.fr on another website, use the link:
In a scientific article or book, the recommended bibliographic citation is: Color in Number on dCode.fr [online website], retrieved on 2025-05-08,