Skip to content
This repository has been archived by the owner on May 6, 2024. It is now read-only.

Releases: cxmeel/colour-utils

1.4.1

10 Jul 14:40
418b561
Compare
Choose a tag to compare

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 and ColorUtils.GetContrastingColour are now marked as
    deprecated for the same reason as above.
  • ColorUtils.GetContrastingColor is now marked as deprecated. The WCAG
    submodule should be used instead, since both APCA and WCAG 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 to WCAG.GetContrastRatio
    but now it will use APCA.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

29 May 17:46
Compare
Choose a tag to compare

What's Changed

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

25 Apr 16:45
Compare
Choose a tag to compare

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 to 3. 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

07 Apr 11:19
Compare
Choose a tag to compare

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 the WCAG 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

26 Nov 19:39
Compare
Choose a tag to compare

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

19 Oct 21:00
Compare
Choose a tag to compare

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 palette
  • Complementary - Generates a complementary colour palette (essentially .Invert() or .Rotate(..., 180))
  • Monochromatic - Generates a monochromatic colour palette
  • SplitComplementary - Generates a split complementary colour palette
  • Tetradic - Generates a tetradic colour palette
  • Triadic - Generates a triadic colour palette
  • Vibrant - Determines the most vibrant colour when passed an array of colours

1.0.3

12 Aug 21:31
2838dfc
Compare
Choose a tag to compare
  • Added .Rotate method to rotate the hue of a given Color3

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!

1.0.2

11 Aug 11:25
Compare
Choose a tag to compare
  • Added Typescript typings for use with Roblox-TS
  • Added .Invert method to invert Color3s
  • Added .isDark convenience method to determine if a Color3 is a dark colour
  • Added .isLight convenience method to determine if a Color3 is a light colour
  • Published to NPM

1.0.1

28 Mar 18:16
Compare
Choose a tag to compare
  • Added threshold as a third argument to Emphasise

1.0.0

27 Mar 03:07
Compare
Choose a tag to compare
First commit