Draft
Conversation
- Updated syntax registration to use new API, including functions and module - Reimplement all colour utility classes (ColorHSL, ColorHSB, ColorUtils) - Move Color class registration to module
- Has since been added to ColorRGB as a static method
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Continuation of #7246. That PR was a bit messy in the end (changing files which didn't need to be changed, etc.), so this will be a cleaner version of it which I intend to maintain.
Problem
Skript doesn't currently have any colour-related syntax. This PR adds a few colour manipulation expressions and functions. While there is more that could be added, these are the main ones. Find below a list of new syntax:
shadefunction: shades a colour by a given amount, optionally using HSL adjustmentstintfunction: tints a colour by a given amount, optionally using HSL adjustmentscolourBrightnessfunction: adjusts the brightness of a colour by a given amount. This is similar to, but not the same as, theshadeandtintfunctionsgrayscalefunction: converts a colour to its grayscale equivalentsepiatonefunction: converts a colour to its sepiatone equivalentThis PR also adds
channelas an option inExprARGB.Solution
ColorHSL,ColorHSB,ColorUtils).SkriptColors currently.Testing Completed
I used this script to do some basic testing in the early stages of the PR, so feel free to try it:
Supporting Information
Shouldn't be any breaking changes. Considering removing the SkriptColor class entirely, and defining each value as it's own static constant in ColorRGB, or a new class like ColorPreset or something, so that they can be properly serialized. Still not sure what exactly causes
SkriptColors only not to be serialized.Completes: none
Related: #7246 #
AI assistance: none