{"id":"kickdosage/pigment","name":"pigment","scope":"kickdosage","platform":"roblox","description":"A collection of color utilities for Roblox.","version":"0.1.0","latest":"0.1.0","versions":["0.1.0"],"license":"MIT","licenseRating":"safe","licenseCaveats":["The package archive does not include its license text; the license is declared in its manifest metadata."],"licenseVerified":false,"dependencies":{},"integrity":"b5c1196e244d6b89c40f2e1daa9c5c6a8a6f6550565c98646455866856191c7a","likes":0,"downloads":0,"install":"forest install kickdosage/pigment","url":"https://forest.dev/p/roblox/kickdosage/pigment","files":"https://api.forest.dev/ai/package/roblox/kickdosage/pigment/files","readme":"# OVERVIEW\n`pigment` is a collection of utility functions for working with colors in Roblox.\n\n# API REFERENCE\n## hsl(hue, saturation, lightness)\nA wrapper around `Color3.fromHSV` to avoid using the [0, 1] range.\n```luau\nlocal hsl = pigment.hsl\nlocal color = hsl(0, 0, 90)\n```\n\n## get_rgb_relative_luminance(color)\nReturns the total luminance of a color.\n```luau\nlocal hsl = pigment.hsl\n\nlocal color = hsl(0, 0, 25),\nlocal luminance = pigment.get_rgb_relative_luminance(color)\n```\n\n## is_color_dark(color)\nDetermines if the provided color is dark.\n```luau\nlocal hsl = pigment.hsl\n\nlocal color = hsl(0, 0, 25),\nlocal is_dark = pigment.is_color_dark(color)\n```\n\n## is_color_sequence_dark(color_sequence)\nDetermines if the provided ColorSequence is dark, based on the average luminance of the colors in the sequence.\n```luau\nlocal hsl = pigment.hsl\n\nlocal color_sequence = ColorSequence.new({\n    ColorSequenceKeypoint.new(0, hsl(0, 0, 10)),\n    ColorSequenceKeypoint.new(1, hsl(0, 0, 90))\n}),\n\nlocal is_dark = pigment.is_color_sequence_dark(color_sequence)\n```\n\n## get_brightest_color_in_color_sequence(color_sequence)\nReturns the color with the highest luminance.\n```luau\nlocal hsl = pigment.hsl\n\nlocal color_sequence = ColorSequence.new({\n    ColorSequenceKeypoint.new(0, hsl(0, 0, 10)),\n    ColorSequenceKeypoint.new(1, hsl(0, 0, 90))\n}),\n\nlocal brightest_color = pigment.get_brightest_color_in_color_sequence(color_sequence)\n```\n\n## evaluaute_color_sequence(color_sequence, elapsed_time)\nTBA\n```luau\nlocal pigment = require(\"path/to/pigment\")\n\nlocal RunService = game:GetService(\"RunService\")\nlocal Part = workspace:WaitForChild(\"Part\")\n\nlocal COLOR_CHANGE_SPEED = 0.5\nlocal COLOR_SEQUENCE = ColorSequence.new({\n    ColorSequenceKeypoint.new(0, Color3.fromRGB(255, 0, 0)),\n    ColorSequenceKeypoint.new(0.5, Color3.fromRGB(0, 255, 0)),\n    ColorSequenceKeypoint.new(1, Color3.fromRGB(0, 0, 255))\n})\n\nlocal elapsed_time = 0\nlocal direction = 1\n\nRunService.PreRender:Connect(function(delta_time)\n    elapsed_time = math.clamp(elapsed_time + (delta_time * direction * COLOR_CHANGE_SPEED))\n\n    if elapsed_time == 0 or elapsed_time == 1 then\n        direction = -direction\n    end\n\n    Part.Color = pigment.evaluate_color_sequence()\nend)\n```","readmeTruncated":false}