Advertisement
crabb

yeah yeah beebis colors

Jun 29th, 2020
1,371
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.91 KB | None | 0 0
  1. --[[
  2.     *
  3.     * p1,p2,p3,p4 should be parts in workspace.
  4.     * run in your studio's console, not ingame.
  5.     * suwacrab 2020:29:06
  6. --]]
  7.  
  8. local function hextoclr(h)
  9.     local r = bit32.rshift(h,16)
  10.     local g = bit32.band(bit32.rshift(h,8),255)
  11.     local b = bit32.band(h,255)
  12.     return Color3.fromRGB(r,g,b)
  13. end
  14.  
  15. local c = {
  16.     hextoclr(0xf8e3c4),
  17.     hextoclr(0xcc3495),
  18.     hextoclr(0x6b1fb1),
  19.     hextoclr(0x0b0630)
  20. }
  21.  
  22. local pnts = {}
  23. local cf_pnts = {}
  24. local c3_pnts = {}
  25.  
  26. local deb = game:GetService("Debris")
  27.  
  28. local function updt_pnts()
  29.     for i = 1,4 do
  30.         pnts[i] = workspace["p"..i]
  31.         cf_pnts[i] = pnts[i].CFrame
  32.         --c3_pnts[i] = c[i]
  33.         c3_pnts[i] = pnts[i].Color
  34.         --pnts[i].Color = c[i]
  35.     end
  36. end
  37.  
  38. local function bez_3(a,b,c,f)
  39.     local l1 = a:lerp(b,f)
  40.     local l2 = b:lerp(c,f)
  41.     return l1:lerp(l2,f)
  42. end
  43.  
  44. local function bez_m(m,f)
  45.     local bt = {}
  46.     for i = 1,#m-2 do
  47.         local a,b,c = m[i],m[i+1],m[i+2]
  48.         bt[#bt+1] = a:lerp(b,f)
  49.         bt[#bt+1] = b:lerp(c,f)
  50.     end
  51.     local l = bt[1]:lerp(bt[2],f)
  52.     if #bt > 2 then
  53.         for i = 3,#bt do
  54.             l = l:lerp(bt[i],f)
  55.         end
  56.     end
  57.     return l
  58. end
  59.  
  60. for t = 0,15*5 do
  61.     updt_pnts()
  62.     for i = 0,255,1 do
  63.         local dt = i/256
  64.         local p = Instance.new("Part")
  65.         p.Size = Vector3.new(1,1,1)*8
  66.         p.Shape = "Ball"
  67.         --p.Material = "Neon"
  68.         p.CFrame = bez_m(cf_pnts,dt)
  69.         p.Color = bez_m(c3_pnts,dt)
  70.         deb:AddItem(p,1/15)
  71.         p.Parent = workspace
  72.     end
  73.     wait()
  74. end
  75.  
  76. -- extra: palette exporting.
  77. local pal_export = true
  78. if pal_export then
  79.     local pal_len = 0x100;
  80.     local palstr = {"JASC-PAL\n","0100\n",
  81.         ("%d\n"):format(pal_len)
  82.     }
  83.     for i = 0,pal_len-1 do
  84.         local clr = bez_m(c3_pnts,i/pal_len)
  85.         local r = clr.r*255
  86.         local g = clr.g*255
  87.         local b = clr.b*255
  88.         palstr[#palstr+1] = ("%d %d %d\n"):format(
  89.             math.floor(r),math.floor(g),math.floor(b)
  90.         )
  91.     end
  92.     local nv = Instance.new("StringValue",workspace)
  93.     nv.Name = "palette export"
  94.     nv.Value = table.concat(palstr)
  95. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement