сделай красивый бело фиолетовый ui
local InterfaceBuild = '3K3W'
local Release = "Build 1.67"
local RayfieldFolder = "Rayfield"
local ConfigurationFolder = RayfieldFolder.."/Configurations"
local ConfigurationExtension = ".rfld"
local settingsTable = {
	General = {
		-- if needs be in order just make getSetting(name)
		rayfieldOpen = {Type = 'bind', Value = 'K', Name = 'Rayfield Keybind'},
		-- buildwarnings
		-- rayfieldprompts

	},
}

local HttpService = game:GetService("HttpService")
local RunService = game:GetService("RunService")

-- Environment Check
local useStudio = RunService:IsStudio() or false

local settingsCreated = false
local cachedSettings
local prompt = useStudio and require(script.Parent.prompt) or loadstring(game:HttpGet('https://raw.githubusercontent.com/SiriusSoftwareLtd/Sirius/refs/heads/request/prompt.lua'))()
local request = (syn and syn.request) or (fluxus and fluxus.request) or (http and http.request) or http_request or request



local function loadSettings()
	local file = nil

	if isfolder and isfolder(RayfieldFolder) then
		if isfile and isfile(RayfieldFolder..'/settings'..ConfigurationExtension) then
			file = readfile(RayfieldFolder..'/settings'..ConfigurationExtension)
		end
	end

	if file then
		local success, decodedFile = pcall(function() return HttpService:JSONDecode(file) end)
		if success then
			file = decodedFile
		else
			file = {}
		end
	else
		file = {}
	end


	if not settingsCreated then 
		cachedSettings = file
		return
	end

	if file ~= {} then
		for categoryName, settingCategory in pairs(settingsTable) do
			if file[categoryName] then
				for settingName, setting in pairs(settingCategory) do
					if file[categoryName][settingName] then
						setting.Value = file[categoryName][settingName].Value
						setting.Element:Set(setting.Value)
					end
				end
			end
		end
	end
end

if debugX then
	warn('Now Loading Settings Configuration')
end

loadSettings()

if debugX then
	warn('Settings Loaded')
end

local RayfieldLibrary = {
	Flags = {},
	Theme = {
		Default = {
			TextColor = Color3.fromRGB(240, 240, 240),

			Background = Color3.fromRGB(25, 25, 25),
			Topbar = Color3.fromRGB(34, 34, 34),
			Shadow = Color3.fromRGB(20, 20, 20),

			NotificationBackground = Color3.fromRGB(20, 20, 20),
			NotificationActionsBackground = Color3.fromRGB(230, 230, 230),

			TabBackground = Color3.fromRGB(80, 80, 80),
			TabStroke = Color3.fromRGB(85, 85, 85),
			TabBackgroundSelected = Color3.fromRGB(210, 210, 210),
			TabTextColor = Color3.fromRGB(240, 240, 240),
			SelectedTabTextColor = Color3.fromRGB(50, 50, 50),

			ElementBackground = Color3.fromRGB(35, 35, 35),
			ElementBackgroundHover = Color3.fromRGB(40, 40, 40),
			SecondaryElementBackground = Color3.fromRGB(25, 25, 25),
			ElementStroke = Color3.fromRGB(50, 50, 50),
			SecondaryElementStroke = Color3.fromRGB(40, 40, 40),

			SliderBackground = Color3.fromRGB(50, 138, 220),
			SliderProgress = Color3.fromRGB(50, 138, 220),
			SliderStroke = Color3.fromRGB(58, 163, 255),

			ToggleBackground = Color3.fromRGB(30, 30, 30),
			ToggleEnabled = Color3.fromRGB(0, 146, 214),
			ToggleDisabled = Color3.fromRGB(100, 100, 100),
			ToggleEnabledStroke = Color3.fromRGB(0, 170, 255),
			ToggleDisabledStroke = Color3.fromRGB(125, 125, 125),
			ToggleEnabledOuterStroke = Color3.fromRGB(100, 100, 100),
			ToggleDisabledOuterStroke = Color3.fromRGB(65, 65, 65),

			DropdownSelected = Color3.fromRGB(40, 40, 40),
			DropdownUnselected = Color3.fromRGB(30, 30, 30),

			InputBackground = Color3.fromRGB(30, 30, 30),
			InputStroke = Color3.fromRGB(65, 65, 65),
			PlaceholderColor = Color3.fromRGB(178, 178, 178)
		},
	}
}


-- Services
local UserInputService = game:GetService("UserInputService")
local TweenService = game:GetService("TweenService")
local Players = game:GetService("Players")
local CoreGui = game:GetService("CoreGui")

-- Interface Management

local Rayfield = useStudio and script.Parent:FindFirstChild('Rayfield') or game:GetObjects("rbxassetid://10804731440")[1]
local buildAttempts = 0
local correctBuild = false
local warned
local globalLoaded

repeat
	if Rayfield:FindFirstChild('Build') and Rayfield.Build.Value == InterfaceBuild then
		correctBuild = true
		break
	end

	correctBuild = false

	if not warned then
		warn('Rayfield | Build Mismatch')
		print('Rayfield may encounter issues as you are running an incompatible interface version ('.. ((Rayfield:FindFirstChild('Build') and Rayfield.Build.Value) or 'No Build') ..').\n\nThis version of Rayfield is intended for interface build '..InterfaceBuild..'.')
		warned = true
	end

	toDestroy, Rayfield = Rayfield, useStudio and script.Parent:FindFirstChild('Rayfield') or game:GetObjects("rbxassetid://10804731440")[1]
	if toDestroy and not useStudio then toDestroy:Destroy() end

	buildAttempts = buildAttempts + 1
until buildAttempts >= 2

Rayfield.Enabled = false

if gethui then
	Rayfield.Parent = gethui()
elseif syn and syn.protect_gui then 
	syn.protect_gui(Rayfield)
	Rayfield.Parent = CoreGui
elseif not useStudio and CoreGui:FindFirstChild("RobloxGui") then
	Rayfield.Parent = CoreGui:FindFirstChild("RobloxGui")
elseif not useStudio then
	Rayfield.Parent = CoreGui
end

if gethui then
	for _, Interface in ipairs(gethui():GetChildren()) do
		if Interface.Name == Rayfield.Name and Interface ~= Rayfield then
			Interface.Enabled = false
			Interface.Name = "Rayfield-Old"
		end
	end
elseif not useStudio then
	for _, Interface in ipairs(CoreGui:GetChildren()) do
		if Interface.Name == Rayfield.Name and Interface ~= Rayfield then
			Interface.Enabled = false
			Interface.Name = "Rayfield-Old"
		end
	end
end


local minSize = Vector2.new(1024, 768)
local useMobileSizing

if Rayfield.AbsoluteSize.X < minSize.X and Rayfield.AbsoluteSize.Y < minSize.Y then
	useMobileSizing = true
end

if UserInputService.TouchEnabled then
	useMobilePrompt = true
end


-- Object Variables

local Main = Rayfield.Main
local MPrompt = Rayfield:FindFirstChild('Prompt')
local Topbar = Main.Topbar
local Elements = Main.Elements
local LoadingFrame = Main.LoadingFrame
local TabList = Main.TabList
local dragBar = Rayfield:FindFirstChild('Drag')
local dragInteract = dragBar and dragBar.Interact or nil
local dragBarCosmetic = dragBar and dragBar.Drag or nil

local dragOffset = 255
local dragOffsetMobile = 150

Rayfield.DisplayOrder = 100
LoadingFrame.Version.Text = Release


local Icons = useStudio and require(script.Parent.icons) or loadstring(game:HttpGet('https://raw.githubusercontent.com/SiriusSoftwareLtd/Rayfield/refs/heads/main/icons.lua'))()

-- Variables

local CFileName = nil
local CEnabled = false
local Minimised = false
local Hidden = false
local Debounce = false
local searchOpen = false
local Notifications = Rayfield.Notifications

local SelectedTheme = RayfieldLibrary.Theme.Default

local function ChangeTheme(Theme)
    if typeof(Theme) == 'string' then
        SelectedTheme = RayfieldLibrary.Theme[Theme]
    elseif typeof(Theme) == 'table' then
        SelectedTheme = Theme
    end

    -- Глобальная конфигурация градиента
    local gradientConfig = {
        Color = ColorSequence.new({
            ColorSequenceKeypoint.new(0, Color3.fromRGB(170, 0, 255)),
            ColorSequenceKeypoint.new(0.5, Color3.fromRGB(120, 75, 255)),
            ColorSequenceKeypoint.new(1, Color3.fromRGB(50, 0, 120))
        }),
        Rotation = 90  -- Направление градиента
    }

    -- Функция для применения градиента
    local function applyGradient(element)
        if element:IsA("GuiObject") and element.Visible then
            local gradient = element:FindFirstChild("BackgroundGradient") or Instance.new("UIGradient")
            gradient.Name = "BackgroundGradient"
            gradient.Color = gradientConfig.Color
            gradient.Rotation = gradientConfig.Rotation
            gradient.Parent = element
            element.BackgroundTransparency = 1
        end
    end

    -- Применяем градиент к основным элементам
    local function applyGradientToDescendants(parent)
        for _, child in ipairs(parent:GetDescendants()) do
            if child:IsA("Frame") or child:IsA("TextButton") or child:IsA("ImageButton") then
                applyGradient(child)
            end
        end
    end

    -- Основные элементы интерфейса
    applyGradient(Rayfield.Main)

    -- Применяем градиенты к верхней панели
    if Rayfield.Main.Topbar then
        applyGradient(Rayfield.Main.Topbar)
        applyGradientToDescendants(Rayfield.Main.Topbar)
    end

    -- Применяем градиенты к вкладкам и их элементам
    if Rayfield.Main.TabList then
        applyGradient(Rayfield.Main.TabList)
        applyGradientToDescendants(Rayfield.Main.TabList)
    end

    -- Применяем градиенты ко всем вкладкам
    if Rayfield.Main.Elements then
        applyGradientToDescendants(Rayfield.Main.Elements)
    end

    -- Обновление текста и обводки
    for _, descendant in ipairs(Rayfield:GetDescendants()) do
        if descendant:IsA("TextLabel") or descendant:IsA("TextBox") or descendant:IsA("TextButton") then
            descendant.TextColor3 = SelectedTheme.TextColor
        elseif descendant:IsA("UIStroke") then
            descendant.Color = SelectedTheme.ElementStroke
        end
    end
end