Mô đun:SpectralColor/tài liệu

Bách khoa toàn thư mở Wikipedia

This module generates the 'rgb(r,g,b)' HTML code of the approximate color of a given wavelength.

Sử dụng[sửa mã nguồn]

exported function :

  • Lambdacolor(frame) – returns the "rgb(r,g,b)" code of the wavelength given as first argument

Uses :

  • mw.frame – args[1] = longueur d'onde en nanomètres (entier)

Ghi chú : Bảng màu xuất phát từ Tập tin:Spectrum-sRGB-low.svg. Tables are big and by step of 2 nm, so interpolation is not necessary

Ví dụ[sửa mã nguồn]

  • Spectral lines of mercury 405 nm(ultraviolet), 436 nm, 546 nm and a doublet near 578 nm
  • Triplet of magnesium near 517 nm
  • Doublet of sodium near 589 nm
  • Spectral line of hydrogen at 656 nm
  • {{#gọi:SpectralColor|lambdacolor|589}} gives 'rgb(255,145,0)'