#Shift = 0
#Delay = 1
#Delay1 = 0.07
#Delay2 = 0.15

IncludeFile "LSDemo (plasmabeam).pb"

Procedure.l RealFireOrBeamColor(xColor.f)
  Define.l xColorR

  If xColor > 1
    xColorR = $ffffff
    ElseIf xColor < 1/3
    xColorR = xColor * 3 * $100
    ;xColorR = xColor * 3 * $100
    If xColorR > $ff
      xColorR = $ff
      EndIf
    ElseIf xColor > 2/3
    xColorR = (xColor - 2/3) * 3 * $81 ;$100
    If xColorR > $80 ;$ff
      xColorR = $80 ;$ff
      EndIf
    xColorR = xColorR * $10000 + $7fffff
    Else
    xColorR = (xColor - 1/3) * 3 * $80 ;$100
    If xColorR > $7f ;$ff
      xColorR = $7f ;$ff
      EndIf
    xColorR = xColorR * $10200 + $ff
    ;xColorR = $ff0000
    EndIf

  ProcedureReturn xColorR
  EndProcedure
; IDE Options = PureBasic 4.31 (Windows - x86)
; CursorPosition = 34
; FirstLine = 9
; Folding = -
; EnableAsm
; DisableDebugger
; AddResource = D:\DEV\Software\Libraries\LineSpec\Demo applications\source\LSDemo (plasmabeam).rc