This repository has been archived by the owner on May 6, 2024. It is now read-only.
Releases: cxmeel/colour-utils
Releases · cxmeel/colour-utils
1.4.1
What's Changed
Added
- Implemented
Palette.Nearest
method, which returns the nearest colour in a
palette to a given colour. - Implemented
LAB.Lerp
method, which returns a colour between two colours in
the LAB colour space. - Missing TypeScript types for new methods and
Hex.fromHexRGBA
. - CI workflow to ensure code is formatted and linted correctly.
Fixed
- Due to a typo, the
APCA.GetContrastRatio
method was throwing an error when
attempting to calculate the contrast ratio for certain colours.
Changed
All deprecated methods will output warnings to the console when used for the
first time. This is to help users migrate to the new methods.
- This project's toolchain is now managed by aftman. Use of foreman is not recommended.
- All instances of the word "colour" have been changed to "color" to match the
US spelling and keep consistency with the Roblox API. ColorUtils.Emphasise
andColorUtils.GetContrastingColour
are now marked as
deprecated for the same reason as above.ColorUtils.GetContrastingColor
is now marked as deprecated. TheWCAG
submodule should be used instead, since bothAPCA
andWCAG
provide two
different methods for calculating contrast ratio.ColorUtils.GetContrastRatio
is now marked as deprecated and implements a
compatibility layer. Previously this was a redirect toWCAG.GetContrastRatio
but now it will useAPCA.GetContrastRatio
because it is more accurate.WCAG
values (0-21
) will be returned for backwards compatibility until the method is
removed in a future release.Palette.Tailwind
will now produce a darker 950 shade, in line with
Tailwind v3.3.2. Note that the
generated palette will be slightly different to tailwind's, since the algorithm
used to generate the palette is different.
Full Changelog: 1.3.1...1.4.1
1.3.1
What's Changed
- v1.3.1 by @csqrl
Added
Blend.Transparency
- Applies "transparency" to a Color3, where the resulting colour simulates the process of overlaying a colour with transparency to a given background.Hex.fromHexRGBA
- Converts a hex code with an alpha channel to a Color3. You must pass a background colour to this method if your background is not black (Color3.new(0, 0, 0)
)!
Full Changelog: 1.3.0...1.3.1
1.3.0
What's Changed
Added
- Implemented colour space conversions.
HSL
(.fromHSL, .toHSL
).LAB
(.fromLAB, .toLAB
) (:test_tube: experimental).LCH
(.fromLCH, .toLCH
) (:test_tube: experimental).
- Saturation methods to either saturate or desaturate a colour.
- Tailwind CSS-style palette generator - Generates 10 swatches, given a base colour, and returns a
TailwindPalette
object (see the docs for more details).
Changed
- Updated the docs for Hex and Int. The converter methods were previously documented in PascalCase, but they should have been documented in camelCase.
- The
Palette.Monochromatic
method now accepts an optional second parameter,swatches
, which defaults to3
. This is to allow for more control over the number of swatches generated.⚠️ Warning: The behaviour of monochromatic has been changed to allow for more control over the number of swatches generated.- The new behaviour will return
X
amount of swatches, including the base colour. The results do not necessarily include a single lighter and darker swatch, and the resulting array is now sorted from darkest to lightest (most vibrant).
Full Changelog: 1.2.0...1.3.0
1.2.0
What's Changed
Added
WCAG
submodule to house the current.GetContrastRatio
and.GetContrastingColour
methods.APCA
submodule, which contains an updated version of.GetContrastRatio
.- Implemented colour blindness simulation under the
Blind
submodule.- Supports the Trichroma-, Protan-, Deutan-, Tritan- and Achroma- groups.
- Includes friendly "
Enums
" for non-scientists.
- Documentation site using moonwave.
- TypeScript alias for
.GetContrastingColour
in root namespace (previously only Luau).
Changed
.GetContrastRatio
and.GetContrastingColour
now redirect to theWCAG
submodule.- Updated toolchain to use rojo 7; fixed other dependencies to an exact version.
Removed
- Removed
rotriever.toml
to drop support for kayak and other rotriever-based package managers.
Full Changelog: 1.1.1...1.2.0
1.1.1
What's Changed
- Added
GetContrastingColour
to adjust a foreground colour to meet the minimum contrast ratio on a background colour
Full Changelog: 1.1.0...1.1.1
1.1.0
Full Changelog: 1.0.3...1.1.0
- Added a
.GetPerceivedBrightness
method to return a value representing colour visibility
There is now a submodule designed for colour harmony and theming. These methods include:
Analogous
- Generates an analogous colour paletteComplementary
- Generates a complementary colour palette (essentially.Invert()
or.Rotate(..., 180)
)Monochromatic
- Generates a monochromatic colour paletteSplitComplementary
- Generates a split complementary colour paletteTetradic
- Generates a tetradic colour paletteTriadic
- Generates a triadic colour paletteVibrant
- Determines the most vibrant colour when passed an array of colours
1.0.3
- Added
.Rotate
method to rotate the hue of a givenColor3
Blending operations have been implemented in this release. This allows "mixing" of colours using one of five currently available methods:
- Burn
- Dodge
- Multiply
- Overlay
- Screen
They hopefully 🤞 work as expected. Please notify if you run into any issues with these!