You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

@uiw/codemirror-extensions-color

Package Overview
Dependencies
Maintainers
2
Versions
96
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@uiw/codemirror-extensions-color

Color Extensions for CodeMirror6.

4.24.2
latest
Source
npmnpm
Version published
Weekly downloads
5.3K
-18.69%
Maintainers
2
Weekly downloads
 
Created
Source
Using my app is also a way to support me:
Vidwall Mousio Hint Mousio Musicer Audioer FileSentinel FocusCursor Videoer KeyClicker DayBar Iconed RightMenu Master Quick RSS Quick RSS Web Serve Copybook Generator DevTutor for SwiftUI RegexMate Time Passage Iconize Folder Textsound Saver Create Custom Symbols DevHub Resume Revise Palette Genius Symbol Scribe

Color Extensions

Buy me a coffee npm version

Color Extensions for CodeMirror6.

Codemirror Extensions Color

Install

npm install @uiw/codemirror-extensions-color --save

Usage

import CodeMirror from '@uiw/react-codemirror';
import { color, colorView, colorTheme } from '@uiw/codemirror-extensions-color';

function App() {
  return (
    <CodeMirror
      value="body { color: #333; }"
      extensions={[color]}
      // ------ Or ------
      // extensions={[colorView(false), colorTheme]}
      height="200px"
    />
  );
}
export default App;
import { EditorView } from '@codemirror/view';
import { EditorState } from '@codemirror/state';
import { color } from '@uiw/codemirror-extensions-color';

const state = EditorState.create({
  doc: 'body { color: #333; }',
  extensions: [color],
});

const view = new EditorView({
  parent: document.querySelector('#editor'),
  state,
});

API

import { ViewPlugin, EditorView, ViewUpdate, DecorationSet } from '@codemirror/view';
import { Extension } from '@codemirror/state';
export declare enum ColorType {
  rgb = 'RGB',
  hex = 'HEX',
  named = 'NAMED',
  hsl = 'HSL',
}
export interface ColorState {
  from: number;
  to: number;
  alpha: string;
  colorType: ColorType;
}
export declare const colorView: (showPicker?: boolean) => ViewPlugin<{
  decorations: DecorationSet;
  update(update: ViewUpdate): void;
  changePicker(view: EditorView, canBeEdited: boolean): void;
}>;
export declare const colorTheme: Extension;
export declare const color: Extension;

Contributors

As always, thanks to our amazing contributors!

Made with action-contributors.

License

Licensed under the MIT License.

Keywords

codemirror

FAQs

Package last updated on 29 Jul 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.