跳至內容

模板:RGB

維基百科,自由的百科全書
文件圖示 模板文件[檢視] [編輯] [歷史] [清除快取]

用法[編輯]

Converts three 8-bit numbers or three percentages to a "rgb(r,g,b)" value, usable in CSS color properties. This template can be substituted.

Useful for all sorts of color-related nefarious purposes.

輸入
  • three parameters, each numeric in the range 0..255 (larger numbers will wrap around)
輸出
  • a triplet of two-digit hex numbers

範例[編輯]

  • {{RGB|0|0|0}} gives rgb(0,0,0)
  • {{subst:RGB|0|0|0}} gives rgb(0,0,0)
  • {{RGB|123|45|67|}} gives rgb(123,45,67)
  • {{subst:RGB|123|45|67}} gives rgb(123,45,67)
  • {{RGB|255|255|255}} gives rgb(255,255,255)
  • {{subst:RGB|255|255|255}} gives rgb(255,255,255)
  • {{RGB|0%|0%|0%}} gives rgb(0%,0%,0%)
  • {{RGB|123%|45%|67%|}} gives rgb(123%,45%,67%)
  • {{RGB|100%|100%|100%}} gives rgb(100%,100%,100%)

參見[編輯]

  • {{Hex3}} for formating as a "#RRGGBB" hex value