MCPcopy Index your code
hub / github.com/dokozero/okcolor

github.com/dokozero/okcolor @11.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release 11.0 ↗ · + Follow
140 symbols 473 edges 116 files 0 documented · 0% updated 12mo ago11.0 · 2025-04-29★ 75
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Easier color palettes and accessibility

OkColor

This is a plugin for Figma, see its community page.

Check https://github.com/users/dokozero/projects/1 for the roadmap.

Picking color and creating balanced color palettes with Figma is not an easy task, HSL and HSB are not perceptually uniform, HSL's lightness is relative to the current hue, so for each of them, the real perceived 50% lightness is not at L 50.

Same problem with hue, if we make a palette from hue 0 to 70 with the same incremental value, we'll get a palette that is not perceptually progressive, some hue changes will seem bigger than others.

We also have a problem known as the “Abney effect”, mainly in the blue hues. If we take the hue 240, it shifts from blue to purple when we update the lightness.

OkColor solves all these problems and more, its params are reliable and uniform, you know what you'll get.

If we change a color hue in OkLCH and keep the same lightness value, we know that the resulting color will have the same perceived lightness.

You can also easily create perceptually uniform color palettes, pick colors in P3 gamut, use the relative chroma (see this thread for more infos) and more.

For more details, you can check plugin community's page.

Credits

This plugin is made possible by the Culori JS library and the creator of these color models: Björn Ottosson.

The rendering of the color picker is done by freydev using WebGL shaders.

The APCA contrast feature is made possible by the work of Myndex .

To know more about these uniform color spaces, you can check the original article from Björn Ottosson: Oksvh and Okhsl and the one from oklch.com's creators: OKLCH in CSS: why we moved from RGB and HSL.

Core symbols most depended-on inside this repo

getColorHxyDecimals
called by 31
src/ui/helpers/colors/getColorHxyDecimals/getColorHxyDecimals.ts
getLinearMappedValue
called by 16
src/ui/helpers/getLinearMappedValue/getLinearMappedValue.ts
convertHxyToRgb
called by 12
src/ui/helpers/colors/convertHxyToRgb/convertHxyToRgb.ts
sendMessageToBackend
called by 12
src/ui/helpers/sendMessageToBackend/sendMessageToBackend.ts
getContrastFromBgandFgRgba
called by 10
src/ui/helpers/contrasts/getContrastFromBgandFgRgba/getContrastFromBgandFgRgba.ts
convertRelativeChromaToAbsolute
called by 9
src/ui/helpers/colors/convertRelativeChromaToAbsolute/convertRelativeChromaToAbsolute.ts
getColorPickerResolutionInfos
called by 8
src/ui/helpers/colors/getColorPickerResolutionInfos/getColorPickerResolutionInfos.ts
convertRgbToHxy
called by 8
src/ui/helpers/colors/convertRgbToHxy/convertRgbToHxy.ts

Shape

Function 130
Enum 10

Languages

TypeScript100%

Modules by API surface

src/ui/components/ColorPicker/ColorPicker.tsx14 symbols
src/types.ts10 symbols
src/ui/components/ColorCodeInputs/ColorCodeInputs.tsx7 symbols
src/backend/main.ts7 symbols
src/ui/components/SettingsScreen/SettingsScreen.tsx4 symbols
src/ui/helpers/contrasts/WCAGcontrast/WCAGcontrast.ts3 symbols
src/ui/components/sliders/OpacitySlider/OpacitySlider.tsx3 symbols
src/ui/components/single-input-with-lock/ContrastInput/ContrastInput.tsx3 symbols
src/ui/components/FillOrStrokeToggle/FillOrStrokeToggle.tsx3 symbols
src/ui/components/ColorValueInputs/ColorValueInputs.tsx3 symbols
src/ui/helpers/copyToClipboard/copyToClipboard.ts2 symbols
src/ui/components/top-bar/SettingsToggle/SettingsToggle.tsx2 symbols

For agents

$ claude mcp add okcolor \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact