Changeset - 8d6792a6ffdb
[Not reviewed]
default
0 4 1
drewp@bigasterisk.com - 21 months ago 2023-05-25 23:28:04
drewp@bigasterisk.com
use onecolor in TS
5 files changed with 25 insertions and 3 deletions:
0 comments (0 inline, 0 general)
light9/web/lib/onecolor.d.ts
Show inline comments
 
new file 100644
 
type ColorFormat = "hex" | "rgb" | "hsl" | "hsv";
 
interface Color {
 
  clone(): this;
 
  toString(format?: ColorFormat): string;
 
  toJSON(): string;
 
  value(): number;
 
  value(v: number): this;
 
  hex(): string;
 
}
 

	
 
declare function color(value: any): Color;
 

	
 
export = color;
light9/web/light9-color-picker.ts
Show inline comments
 
@@ -5,14 +5,14 @@ import { Literal, NamedNode } from "n3";
 
import { SyncedGraph } from "../web/SyncedGraph";
 
import { ControlValue } from "./Effect";
 
import { GraphToControls } from "./GraphToControls";
 
import { DeviceAttrRow } from "./Light9DeviceControl";
 
import { Choice } from "./Light9Listbox";
 
import { SubEvent } from "sub-events";
 
import color from "onecolor";
 

	
 
//<script src="/lib/color/one-color.js"></script>
 
const log = debug("control");
 

	
 
@customElement("light9-color-picker-float")
 
export class Light9ColorPickerFloat extends LitElement {
 
  static styles = [
 
    css`
package.json
Show inline comments
 
@@ -23,12 +23,13 @@
 
    "d3": "^7.8.4",
 
    "debug": "^4.3.4",
 
    "fpsmeter": "^0.3.1",
 
    "knockout": "^3.5.1",
 
    "lit": "^2.7.4",
 
    "n3": "^1.16.4",
 
    "onecolor": "^4.0.0",
 
    "parse-prometheus-text-format": "^1.1.1",
 
    "reconnectingwebsocket": "^1.0.0",
 
    "sub-events": "^1.9.0",
 
    "sylvester": "^0.0.21",
 
    "typescript": "^5.0.4",
 
    "underscore": "^1.13.6",
pnpm-lock.yaml
Show inline comments
 
@@ -15,12 +15,13 @@ specifiers:
 
  d3: ^7.8.4
 
  debug: ^4.3.4
 
  fpsmeter: ^0.3.1
 
  knockout: ^3.5.1
 
  lit: ^2.7.4
 
  n3: ^1.16.4
 
  onecolor: ^4.0.0
 
  parse-prometheus-text-format: ^1.1.1
 
  reconnectingwebsocket: ^1.0.0
 
  sub-events: ^1.9.0
 
  sylvester: ^0.0.21
 
  typescript: ^5.0.4
 
  underscore: ^1.13.6
 
@@ -42,12 +43,13 @@ dependencies:
 
  d3: 7.8.4
 
  debug: 4.3.4
 
  fpsmeter: 0.3.1
 
  knockout: 3.5.1
 
  lit: 2.7.4
 
  n3: 1.16.4
 
  onecolor: 4.0.0
 
  parse-prometheus-text-format: 1.1.1
 
  reconnectingwebsocket: 1.0.0
 
  sub-events: 1.9.0
 
  sylvester: 0.0.21
 
  typescript: 5.0.4
 
  underscore: 1.13.6
 
@@ -1053,12 +1055,17 @@ packages:
 
  /nanoid/3.3.6:
 
    resolution: {integrity: sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA==}
 
    engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1}
 
    hasBin: true
 
    dev: false
 

	
 
  /onecolor/4.0.0:
 
    resolution: {integrity: sha512-DVekU/5RwE8iWt04loesYKLbePAi1KfWD3W0/7YySESLaMJnVNcdgnjEwA1SIvzqjxtYT52/cFC+tB8csFE1sA==}
 
    engines: {node: '>=0.4.8'}
 
    dev: false
 

	
 
  /parse-prometheus-text-format/1.1.1:
 
    resolution: {integrity: sha512-dBlhYVACjRdSqLMFe4/Q1l/Gd3UmXm8ruvsTi7J6ul3ih45AkzkVpI5XHV4aZ37juGZW5+3dGU5lwk+QLM9XJA==}
 
    dependencies:
 
      shallow-equal: 1.2.1
 
    dev: false
 

	
tsconfig.json
Show inline comments
 
@@ -43,18 +43,19 @@
 
    // "noPropertyAccessFromIndexSignature": true,  /* Require undeclared properties from index signatures to use element accesses. */
 

	
 
    /* Module Resolution Options */
 
    "moduleResolution": "node"                      /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */,
 
    "baseUrl": "./"                                 /* Base directory to resolve non-absolute module names. */,
 
    "paths": {                                      /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */
 
      "sylvester": ["light9/web/lib/sylvester.d.ts"]
 
      "sylvester": ["light9/web/lib/sylvester.d.ts"],
 
      "onecolor": ["light9/web/lib/onecolor.d.ts"]
 
    },
 
    // "rootDirs": [],                              /* List of root folders whose combined content represents the structure of the project at runtime. */
 
    // "typeRoots": ["/my/proj/light9/light9/web/homepage"],                             /* List of folders to include type definitions from. */
 
    // "types": [],                                 /* Type declaration files to be included in compilation. */
 
    // "allowSyntheticDefaultImports": true,        /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */
 
    "allowSyntheticDefaultImports": true,        /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */
 
    "esModuleInterop": true,                        /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
 
    // "preserveSymlinks": true,                    /* Do not resolve the real path of symlinks. */
 
    // "allowUmdGlobalAccess": true,                /* Allow accessing UMD globals from modules. */
 

	
 
    /* Source Map Options */
 
    // "sourceRoot": "",                            /* Specify the location where debugger should locate TypeScript files instead of source locations. */
0 comments (0 inline, 0 general)