Skip to content

Releases: CarbonPackages/Carbon.ColorPicker.OKLCH

1.0.3

24 Oct 21:26
01345ad
Compare
Choose a tag to compare

Full Changelog: 1.0.2...1.0.3

1.0.2

24 Oct 08:04
343307f
Compare
Choose a tag to compare

Full Changelog: 1.0.1...1.0.2

1.0.1

16 Oct 10:55
a9b9a54
Compare
Choose a tag to compare

Full Changelog: 1.0.0...1.0.1

1.0.0

12 Oct 13:33
956fd9c
Compare
Choose a tag to compare

✨ Feature

Add option for data source

Full Changelog: 0.1.6...1.0.0

0.1.6

07 Oct 17:27
8e56752
Compare
Choose a tag to compare

It is now possible to set the contrast threshold (contrastThreshold) for the color name output. Depends on the luminance, the text will be black or white.

Full Changelog: 0.1.5...0.1.6

0.1.5

07 Sep 08:08
c544161
Compare
Choose a tag to compare

Just updated front-end dependencies

Full Changelog: 0.1.4...0.1.5

0.1.4

15 Apr 11:10
347594e
Compare
Choose a tag to compare

✨ Features:

Save also ready to use custom properties

If the mode ist set to all (which is the default), the color picker don't store only the given value, it stores an array with following values:

  • hex: The color in hex format
  • oklch: The color in the [OKLCH] color space
  • coords: The values in the [OKLCH] color space. This is great for any color transformation. Very handy if you use something like the [Tailwind OKLCH Plugin]
  • customProperty: Ready to use custom properties for your CSS. You can set the name via the option customPropertyName, defaults to color
{
  "hex": "#65a30d",
  "oklch": "oklch(64.817% 0.17545 131.68)",
  "coords": {
    "l": 0.64817,
    "c": 0.17545,
    "h": 131.68
  },
  "customProperty": {
    "coords": "--color-l:0.64817;--color-c:0.17545;--color-h:131.68;",
    "oklch": "--color:oklch(64.817% 0.17545 131.68);",
    "hex": "--color:#65a30d;"
  }
}

Add Eel helper ColorConvert.toOkLch(color, precision, customPropertyName)

Converts a HEX color to the object who is used when you set the mode to all.

  • color (string|array, required) The color
  • precision (int) The precision for the color, defaults to 5
  • customPropertyName (string) The name for the ready to use custom property, defaults to 'color'

Example:

${ColorConvert.toOkLch('#65a30d', 4, 'color-main')}

returns

{
  "hex": "#65a30d",
  "oklch": "oklch(64.82% 0.1755 131.7)",
  "coords": {
    "l": 0.6482,
    "c": 0.1755,
    "h": 131.7
  },
  "customProperty": {
    "coords": "--color-main-l:0.6482;--color-main-c:0.1755;--color-main-h:131.7;",
    "oklch": "--color-main:oklch(64.82% 0.1755 131.7);",
    "hex": "--color-main:#65a30d;"
  }
}

Full Changelog: 0.1.3...0.1.4

0.1.3

11 Apr 10:09
c912af1
Compare
Choose a tag to compare

Reduce bundled size

Full Changelog: 0.1.2...0.1.3

0.1.2

27 Mar 10:22
7af147f
Compare
Choose a tag to compare

✨ Show color names on collapsed picker

screenshot

Full Changelog: 0.1.1...0.1.2

0.1.1

21 Mar 23:53
58b9a33
Compare
Choose a tag to compare

✨ Add an option to collapse the picker

There are now even more options on how the picker should look like:

Here you can see some of the combinations:

screenshot

Full Changelog: 0.1.0...0.1.1