redspeed := 0 greenspeed := 0 bluespeed := 0 nowindex := 0 nextdestination := 0 red := random * 255; green := random * 255; blue := random * 255; colorwidth := 0; colorchangemode := 0; colorchangemode := random //色が色々変わる方 if colorchangemode > 0.5 then begin while 256 > nowindex do begin nextdestinationred := random * 255; nextdestinationgreen := random * 255; nextdestinationblue := random * 255; if trunc(random * 15) = 1 then begin nextdestinationred := -20 nextdestinationgreen := -20 nextdestinationblue := -20 end if trunc(random * 15) = 2 then begin nextdestinationred := 265 nextdestinationgreen := 265 nextdestinationblue := 265 end nextdestinationspeed := trunc(random * 5.999) + 5; //10〜39 色が変わるスピードです 大きいほど遅いです nextdestination := nowindex + nextdestinationspeed redspeed := (nextdestinationred - red) / nextdestinationspeed greenspeed := (nextdestinationgreen - green) / nextdestinationspeed bluespeed := (nextdestinationblue - blue) / nextdestinationspeed if nextdestination > 256 then nextdestination := 256 while nextdestination > nowindex do begin red := red + redspeed green := green + greenspeed blue := blue + bluespeed red2 := trunc(red) green2 := trunc(green) blue2 := trunc(blue) if red2 > 255 then red2 := 255 if red2 < 0 then red2 := 0 if green2 > 255 then green2 := 255 if green2 < 0 then green2 := 0 if blue2 > 255 then blue2 := 255 if blue2 < 0 then blue2 := 0 Flame.Gradient[nowindex][0] := red2; Flame.Gradient[nowindex][1] := green2; Flame.Gradient[nowindex][2] := blue2; inc(nowindex); end; end; end; //色が安定している方 if colorchangemode <= 0.5 then begin while 256 > nowindex do begin colorwidth := 128; //色のふれ幅です 大きいほど色が激しく変わります nextdestinationred := red + (random * colorwidth - (colorwidth/2)); nextdestinationgreen := green + (random * colorwidth - (colorwidth/2)); nextdestinationblue := blue + (random * colorwidth - (colorwidth/2)); if nextdestinationred > 255 then nextdestinationred := 255 if nextdestinationgreen > 255 then nextdestinationgreen := 255 if nextdestinationblue > 255 then nextdestinationblue := 255 nextdestinationspeed := trunc(random * 1.999) + 2; //5〜14 色が変わるスピードです 大きいほど遅いです nextdestination := nowindex + nextdestinationspeed redspeed := (nextdestinationred - red) / nextdestinationspeed greenspeed := (nextdestinationgreen - green) / nextdestinationspeed bluespeed := (nextdestinationblue - blue) / nextdestinationspeed if nextdestination > 256 then nextdestination := 256 while nextdestination > nowindex do begin red := red + redspeed green := green + greenspeed blue := blue + bluespeed red2 := trunc(red) green2 := trunc(green) blue2 := trunc(blue) if red2 > 255 then red2 := 255 if red2 < 0 then red2 := 0 if green2 > 255 then green2 := 255 if green2 < 0 then green2 := 0 if blue2 > 255 then blue2 := 255 if blue2 < 0 then blue2 := 0 Flame.Gradient[nowindex][0] := red2; Flame.Gradient[nowindex][1] := green2; Flame.Gradient[nowindex][2] := blue2; inc(nowindex); end; end; end; Calculatecolors;