How to get a certain point of a uigradient

so i want to know how to get a certain point of a uigradient based on my mouses pos so:

image
that would be light blue or like 100,255,100 or whatever the value is and:

image
that would be yellowish-orange? how could i get this? pls help

1 Like

Double post? Uigradient with mouse pos

Use Color3.fromHSV, specifically hue, the first parameter.


View On API Docs


Example:

local frame = script.Parent
local mouse = game:GetService('Players').LocalPlayer:GetMouse()

local xPos = 1 - math.clamp((mouse.X - frame.AbsolutePosition.X) / frame.AbsoluteSize.X, 0, 1)
local color = Color3.fromHSV(xPos, 1, 1) -- The color you're hovering over
1 Like