Skip to content

Releases: rocketbase-io/colors

1.0.0

Choose a tag to compare

@github-actions github-actions released this 28 Aug 20:27

Two new palettes, three more color spaces, and four bugs that had been in hex2rgb and friends since the start. Breaking on both the jdk and the color values — details at the bottom.

new

  • TailwindPalette — 26 families × 11 shades (286 colors), stored in the oklch values Tailwind 4.3.3 defines them in
  • OpenColorPalette — 13 families × 10 shades (130 colors), Open Color 1.9.1
  • Shade enum with ranges: lights(), mids(), darks(), range(from, to) — these also drive randomShade(...)
  • ColorCode interface shared by all three palettes, so getRgbColor(), the contrast helpers and getNearest() work the same everywhere
  • HslColor, OklchColor and OklabColor, plus RgbColor.readColor(...) which takes hex, rgb(), hsl() or oklch()
  • docs with every color as a swatch: https://colors.rocketbase.io

fixed

  • hex2rgb read a single character per channel on six-digit codes and multiplied it by 17, so only repeating pairs like #ffffff came out right — #123456 returned (17, 51, 85) instead of (18, 52, 86)
  • getHexCode() doubled single-digit channels instead of zero-padding them: RgbColor(5, 10, 15) rendered as 55aaff, now 050a0f
  • hex2rgb returns null on invalid hex instead of throwing NumberFormatException
  • ColorPalette.getRandomValue(Collection) had its loop condition inverted — it only returned colors already in the collection, and spun forever on an empty one

breaking

  • jdk-11 baseline, the artifact no longer loads on java 8
  • every ColorPalette constant is a six-digit hex, so the parsing fix shifts getNearest() and both contrast algorithms
  • getNearest() now measures distance in oklab, which matches perceived similarity and gives different answers than the old rgb distance

Build moved from travis to github actions, release now goes through sonatype central publishing. Dependencies: junit 5.14.4, hamcrest 3.0, lombok 1.18.46.

0.6.0

Choose a tag to compare

@melistik melistik released this 12 Jun 19:54
  • added another algorithm for text-color-detection by given background-color
  • added swagger-api annotations for enum
  • added JsonValue to ColorPalette
  • upgraded dependencies for build

0.5.1

Choose a tag to compare

@melistik melistik released this 12 Jun 19:53
  • added shorthand - read rgb/hex within one method

0.5.0

Choose a tag to compare

@melistik melistik released this 25 Feb 20:14

first draft