我使用以下算法將溫度轉換爲RGB顏色。是否有人知道在第二行意味着什麼?在編程中意味着什麼?
設定溫度=溫度\ 100
這是什麼?
Start with a temperature, in Kelvin, somewhere between 1000 and 40000. (Other values may work,
Set Temperature = Temperature \ 100
Calculate Red:
If Temperature <= 66 Then
Red = 255
Else
Red = Temperature - 60
Red = 329.698727446 * (Red^-0.1332047592)
If Red < 0 Then Red = 0
If Red > 255 Then Red = 255
End If
Calculate Green:
If Temperature <= 66 Then
Green = Temperature
Green = 99.4708025861 * Ln(Green) - 161.1195681661
If Green < 0 Then Green = 0
If Green > 255 Then Green = 255
Else
Green = Temperature - 60
Green = 288.1221695283 * (Green^-0.0755148492)
If Green < 0 Then Green = 0
If Green > 255 Then Green = 255
End If
Calculate Blue:
If Temperature >= 66 Then
Blue = 255
Else
If Temperature <= 19 Then
Blue = 0
Else
Blue = Temperature - 10
Blue = 138.5177312231 * Ln(Blue) - 305.0447927307
If Blue < 0 Then Blue = 0
If Blue > 255 Then Blue = 255
End If
End If
它表示整數除法,給出一個整數結果,與浮點除法不同,它給出了一個浮點結果。 – 2015-07-21 03:31:51
爲什麼rgb標籤在這裏?它與 –