Code Monkey home page Code Monkey logo

ngx-color's Introduction

Angular color sketch preview

Angular Color


npm codecov


DEMO: https://ngx-color.vercel.app

About

  • 13 Different Pickers - Sketch, Photoshop, Chrome, Twitter and many more

  • Make Your Own - Use the building block components to make your own

  • This is a port of react-color by casesandberg

Getting Started

Dependencies

Latest version available for each version of Angular

ngx-color Angular
4.1.1 8.x
5.1.4 9.x
6.2.0 10.x 11.x
7.3.3 12.x 13.x
8.0.3 14.x 15.x
current >= 16.x

Install

npm install ngx-color --save

Include Component

import
import { ColorSketchModule } from 'ngx-color/sketch';

@NgModule({
  imports: [
    ColorSketchModule, // added to imports
  ],
})
class YourModule {}
use
<color-sketch [color]="state" (onChangeComplete)="changeComplete($event)"></color-sketch>

Others available

import { ColorAlphaModule } from 'ngx-color/alpha'; // <color-alpha-picker></color-alpha-picker>
import { ColorBlockModule } from 'ngx-color/block'; // <color-block></color-block>
import { ColorChromeModule } from 'ngx-color/chrome'; // <color-chrome></color-chrome>
import { ColorCircleModule } from 'ngx-color/circle'; // <color-circle></color-circle>
import { ColorCompactModule } from 'ngx-color/compact'; // <color-compact></color-compact>
import { ColorGithubModule } from 'ngx-color/github'; // <color-github></color-github>
import { ColorHueModule } from 'ngx-color/hue'; // <color-hue-picker></color-hue-picker>
import { ColorMaterialModule } from 'ngx-color/material'; // <color-material></color-material>
import { ColorPhotoshopModule } from 'ngx-color/photoshop'; // <color-photoshop></color-photoshop>
import { ColorSketchModule } from 'ngx-color/sketch'; // <color-sketch></color-sketch>
import { ColorSliderModule } from 'ngx-color/slider'; // <color-slider></color-slider>
import { ColorSwatchesModule } from 'ngx-color/swatches'; // <color-swatches></color-swatches>
import { ColorTwitterModule } from 'ngx-color/twitter'; // <color-twitter></color-twitter>
import { ColorShadeModule } from 'ngx-color/shade'; // <color-shade-picker></color-shade-picker>

Component API

Color

Color controls what color is active on the color picker. You can use this to initialize the color picker with a particular color, or to keep it in sync with the state of a parent component.

Color accepts either a string of a hex color '#333' or a object of rgb or hsl values { r: 51, g: 51, b: 51 } or { h: 0, s: 0, l: .10 }. Both rgb and hsl will also take a a: 1 value for alpha. You can also use transparent.

<color-sketch color="#fff" (onChangeComplete)="handleChangeComplete($event)"></color-sketch>

In this case, the color picker will initialize with the color #fff. When the color is changed, handleChangeComplete will fire and set the new color to state.

onChange

Pass a function to call every time the color is changed. Use this to store the color in the state of a parent component or to make other transformations.

Keep in mind this is called on drag events that can happen quite frequently. If you just need to get the color once use onChangeComplete.

import { Component } from '@angular/core';
import { ColorEvent } from 'ngx-color';

@Component({
  selector: 'selector-name',
  template: ` <color-sketch (onChange)="handleChange($event)"></color-sketch> `,
})
export class NameComponent {
  constructor() {}

  handleChange($event: ColorEvent) {
    console.log($event.color);
    // color = {
    //   hex: '#333',
    //   rgb: {
    //     r: 51,
    //     g: 51,
    //     b: 51,
    //     a: 1,
    //   },
    //   hsl: {
    //     h: 0,
    //     s: 0,
    //     l: .20,
    //     a: 1,
    //   },
    // }
  }
}

onChangeComplete

Pass a function to call once a color change is complete.

Individual APIs

Some pickers have specific APIs that are unique to themselves:

Alpha

  • width - String | Number, Pixel value for picker width. Default 316px
  • height - String | Number, Pixel value for picker height. Default 16px
  • direction - String, horizontal or vertical. Default horizontal

Block

  • width - string | number, Pixel value for picker width. Default 170px
  • colors - Array of Strings, Color squares to display. Default ['#D9E3F0', '#F47373', '#697689', '#37D67A', '#2CCCE4', '#555555', '#dce775', '#ff8a65', '#ba68c8']
  • triangle - String, Either hide or top. Default top
  • onSwatchHover - (Output) An event handler for onMouseOver on the <Swatch>s within this component. Gives the args (color, event)

Chrome

  • disableAlpha - Bool, Remove alpha slider and options from picker. Default false

Circle

  • width - String | number, Pixel value for picker width. Default 252px
  • colors - Array of Strings, Color squares to display. Default ["#f44336", "#e91e63", "#9c27b0", "#673ab7", "#3f51b5", "#2196f3", "#03a9f4", "#00bcd4", "#009688", "#4caf50", "#8bc34a", "#cddc39", "#ffeb3b", "#ffc107", "#ff9800", "#ff5722", "#795548", "#607d8b"]
  • circleSize - Number, Value for circle size. Default 28
  • circleSpacing - Number, Value for spacing between circles. Default 14
  • onSwatchHover - (Output) An event handler for onMouseOver on the <Swatch>s within this component. Gives the args (color, event)

Compact

  • colors - Array of Strings, Color squares to display. Default ['#4D4D4D', '#999999', '#FFFFFF', '#F44E3B', '#FE9200', '#FCDC00', '#DBDF00', '#A4DD00', '#68CCCA', '#73D8FF', '#AEA1FF', '#FDA1FF', '#333333', '#808080', '#cccccc', '#D33115', '#E27300', '#FCC400', '#B0BC00', '#68BC00', '#16A5A5', '#009CE0', '#7B64FF', '#FA28FF', '#000000', '#666666', '#B3B3B3', '#9F0500', '#C45100', '#FB9E00', '#808900', '#194D33', '#0C797D', '#0062B1', '#653294', '#AB149E']
  • onSwatchHover - (Output) An event handler for onMouseOver on the <Swatch>s within this component. Gives the args (color, event)

Github

  • width - string | number, Pixel value for picker width. Default 212px
  • colors - Array of Strings, Color squares to display. Default ['#B80000', '#DB3E00', '#FCCB00', '#008B02', '#006B76', '#1273DE', '#004DCF', '#5300EB', '#EB9694', '#FAD0C3', '#FEF3BD', '#C1E1C5', '#BEDADC', '#C4DEF6', '#BED3F3', '#D4C4FB']
  • triangle - String, Either hide, top-left or top-right. Default top-left
  • onSwatchHover - (Output) An event handler for onMouseOver on the <Swatch>s within this component. Gives the args (color, event)

Hue

  • width - string | number, Pixel value for picker width. Default 316px
  • height - string | number, Pixel value for picker height. Default 16px
  • direction - String Enum, horizontal or vertical. Default horizontal

Material

None

Photoshop

  • header - String, Title text. Default Color Picker
  • onAccept - (Output), Callback for when accept is clicked.
  • onCancel - (Output), Callback for when cancel is clicked.

Sketch

  • disableAlpha - Bool, Remove alpha slider and options from picker. Default false
  • presetColors - Array of Strings or Objects, Hex strings for default colors at bottom of picker. Default ['#D0021B', '#F5A623', '#F8E71C', '#8B572A', '#7ED321', '#417505', '#BD10E0', '#9013FE', '#4A90E2', '#50E3C2', '#B8E986', '#000000', '#4A4A4A', '#9B9B9B', '#FFFFFF']

    presetColors may also be described as an array of objects with color and title properties: [{ color: '#f00', title: 'red' }] or a combination of both

  • width - Number, Width of picker. Default 200
  • onSwatchHover - An event handler for onMouseOver on the <Swatch>s within this component. Gives the args (color, event)

Slider

  • pointer - React Component, Custom pointer component

Swatches

  • width - string | number, Pixel value for picker width. Default 320
  • height - string | number, Pixel value for picker height. Default 240
  • colors - Array of Arrays of Strings, An array of color groups, each with an array of colors
  • onSwatchHover - (Output) An event handler for onMouseOver on the <Swatch>s within this component. Gives the args (color, event)

Twitter

  • width - string | number, Pixel value for picker width. Default 276px
  • colors - Array of Strings, Color squares to display. Default ['#FF6900', '#FCB900', '#7BDCB5', '#00D084', '#8ED1FC', '#0693E3', '#ABB8C3', '#EB144C', '#F78DA7', '#9900EF']
  • triangle - String, Either hide, top-left or top-right. Default top-left
  • onSwatchHover - (Output) An event handler for onMouseOver on the <Swatch>s within this component. Gives the args (color, event)

Shade

  • width - String | Number, Pixel value for picker width. Default 316px
  • height - String | Number, Pixel value for picker height. Default 16px

GitHub @scttcper  ·  Twitter @scttcper

ngx-color's People

Contributors

angular-cli avatar annacraven avatar colindonovan5 avatar damingerdai avatar greenkeeper[bot] avatar greenkeeperio-bot avatar hbcraft avatar joe-kang avatar mmuenker avatar renovate-bot avatar renovate[bot] avatar scttcper avatar seijiv13 avatar timebutt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

ngx-color's Issues

Change color circle title displayed on hover

When I hover on a color circle, the title shown is hexadecimal related to that color.
Is it possible to set a custom title instead of the hexadecimal

image

Instead of '#ff0000', I want to display a custom title.

Thank you

Dependency deprecation warning: travis-deploy-once (npm)

On registry https://registry.npmjs.org, the "latest" version (v5.0.11) of dependency travis-deploy-once has the following deprecation notice:

We recommend to use Travis Build Stages instead

Marking the latest version of an npm package as deprecated results in the entire package being considered deprecated, so contact the package author you think this is a mistake.

Affected package file(s): package.json

If you don't care about this, you can close this issue and not be warned about travis-deploy-once's deprecation again. If you would like to completely disable all future deprecation warnings then add the following to your config:

"suppressNotifications": ["deprecationWarningIssues"]

Debouncing and customisation

Hi Scott.

I'm working on an app to control animation of an LED strip (SK6812 with four channels: Red, Green, Blue, White).

I've tried a few different libraries, some of which are a little too difficult to use or are designed for applications other than LED light control - I'm really glad I've found yours with its wide choice of built-in components - thank you for all this work! I have a few questions though, but I must say I'm not a very experienced TypeScript developer - I'm learning along the way 😊

The debounce time that is currently configured (100 ms) is a little too fast for my application. I'm looking to slow it down to 500-1000 ms, as otherwise it spams my MQTT broker and overloads the microcontroller used to control the lights.

Below are two pieces of my code. Is there any way I can adjust the debounce rate here? Otherwise, is there any way to built on top of the ColorWrap bit to change that? The this.ledService.cmdFill bit publishes an MQTT message, it's a service I wrote.

<color-hue-picker (onChange)="handleChange($event)"></color-hue-picker>
  handleChange($event: ColorEvent) {
    this.colorRgb = $event.color.rgb;
    this.ledService.cmdFill(this.colorRgb.r, this.colorRgb.g, this.colorRgb.b, 0);
  }

If there's no easy way of doing that, I might fall back to using onChangeComplete instead of onChange, but I'd love to have an option to get the LED strip to change its colour as I drag the slider.

My second question is about what you call a shade slider. As I mentioned before, the LED strip I use offers a fourth colour, white. I'm looking to reuse the shade slider component and replace the hue colour with white so there's nice transition from black to white, which would act as a dimmer for white light. What is the best way to create a custom component on top of your shade slider?

Thank you.

DIV swatches-picker and swatches-overflow have hardcoded inline style

When using <color-swatches> the element has fixed width and height due to inline CSS style attribute.

I believe we should be able to resize that as we see fit based on CSS classes (which are already there but have no chance fighting against style="width: 320px; height: 240px")

Thanks.

P.S. Love the library

[Color] input does not work properly when it contains letter characters

In first place thank you for your work in this library :).

I have noticed a weird behaviour when using the input color. I have this colors array:

 ["#AC8542", "#E6A200", "#E95D39", "#B5123D", "#9A3078", "#46378A", "#00458A", "#0B72B5",
  "#008A8A", "#025428", "#007E41", "#20A54A", "#426F82", "#5D7A9C", "#45A1C8", "#651264"]

I am setting color with the following code: [color] = "product?.color". When the color has letter characters, looks like it looses the focus (selection effect). But if the color does not have letter characters it works properly.

image

here color code is "#025428"

Here I have selected the first one (top left) or the product?.color value refers to top left color so the selected effect should appear.... Here is the behavior....

image

here color code is "#AC8542"

Could you help me with this issue???

Thanks in advance!

Transparency still possible with disableAlpha=true

Hello,

Disabling alpha removes slider as expected (I'm using color-sketch implementation),

But if user types an HEX with a length of 4 such as 1230, it will be converted into a color of #112233 (which is normal behavior), but a transparency set to 0%.
It typically happens when user deletes some chars of a 6-length HEX, coming down to a HEX of 4 and so, transparency.

I think it's a way to bypass the behavior we expect when setting disableAlpha to TRUE.
What do you think ?

Thanks for your time

--
I can do a PR if needed, I've looked into code and it seems to be related with isValidHex(hex: string) / handleChange not taking into account disableAlpha attribute.

The automated release is failing 🚨

🚨 The automated release from the master branch failed. 🚨

I recommend you give this issue a high priority, so other packages depending on you could benefit from your bug fixes and new features.

You can find below the list of errors reported by semantic-release. Each one of them has to be resolved in order to automatically publish your package. I’m sure you can resolve this 💪.

Errors are usually caused by a misconfiguration or an authentication problem. With each error reported below you will find explanation and guidance to help you to resolve it.

Once all the errors are resolved, semantic-release will release your package the next time you push a commit to the master branch. You can also manually restart the failed CI job that runs semantic-release.

If you are not sure how to resolve this, here is some links that can help you:

If those don’t help, or if this issue is reporting something you think isn’t right, you can always ask the humans behind semantic-release.


The push permission to the Git repository is required.

semantic-release cannot push the version tag to the branch master on remote Git repository.

Please refer to the authentication configuration documentation to configure the Git credentials on your CI environment.


Good luck with your project ✨

Your semantic-release bot 📦🚀

Change the border of CirclePicker

Hey man ! Thanks for this great work ! This plugin is just awesome !

I have a question, how can i change the color of circle on CirclePicker ? I've try but i don't see how i can do it...

Thanks again 💯

Troubles setting values for HSL editor

Hello, first of all, thanks for this great library we really appreciate your work.

So, I have a question, and is about a problem that we have when we try to set values to HSL editor.

Here you have the example: https://www.screencast.com/t/oq336Eca6TU

As you could see, HEX and RGB inputs work fine, but on HSL editor, turns values to 0.

Our lines of code are simply like this:
<color-chrome [disableAlpha]='true' [color]='color' (onChangeComplete)='handleCustomColorChange($event)'>

I really appreciate if you could help us to find which is the error and how we could fix it.

Notes:

Actually, we have the 1.2.1 version, but, we have updated to 2.0.1 and the issue doesn't go out

Can't change default colors

Hello. First of all thanks for this great library. I use twitter picker and I can't change the default colors of the picker. I want to change one of the colors from this default array but it doesn't work: ['#FF6900', '#FCB900', '#7BDCB5', '#00D084', '#8ED1FC', '#0693E3', '#ABB8C3', '#EB144C', '#F78DA7', '#9900EF']. Can you help me? I need it immediately.

Action Required: Fix Renovate Configuration

There is an error with this repository's Renovate configuration that needs to be fixed. As a precaution, Renovate will stop PRs until it is resolved.

Error type: Preset name not found within published preset config (monorepo:angularmaterial). Note: this is a nested preset so please contact the preset author if you are unable to fix it yourself.

core.js:6014 ERROR Error: Template error: Can't bind to 'hsl' since it isn't a known property of 'color-saturation'.

Hi,
I getting this error on prod build with IVY compiler enabled.

Can you please look into it and help.

Thanks.

ERROR Error: Template error: Can't bind to 'hsl' since it isn't a known property of 'color-saturation'.
at createUnknownPropertyError (core.js:12759)
at validateAgainstUnknownProperties (core.js:12698)
at elementPropertyInternal (core.js:12603)
at Module.ɵɵproperty (core.js:19773)
at SketchComponent_Template (ngx-color-sketch.js:494)
at executeTemplate (core.js:12177)
at checkView (core.js:13615)
at componentRefresh (core.js:13359)
at refreshChildComponents (core.js:11858)
at refreshDescendantViews (core.js:11757)

Support for angular 5

"@angular/core": "^5.2.11",
"ngx-color": "^4.1.0",

I'm getting an error

webpack: Compiled successfully.
ERROR in src/app/...module.ts(6,35): error TS2307: Cannot find module 'ngx-color/sketch'.

When I ctrl-click on ColorSketchModule It actually navigates inside node_modules, so It's properly installed.
I also tried deleting node_modules and installing from scratch.

Also it works OK with "@angular/core": "~8.2.13", (have created demo project for that)

The automated release is failing 🚨

🚨 The automated release from the master branch failed. 🚨

I recommend you give this issue a high priority, so other packages depending on you could benefit from your bug fixes and new features.

You can find below the list of errors reported by semantic-release. Each one of them has to be resolved in order to automatically publish your package. I’m sure you can resolve this 💪.

Errors are usually caused by a misconfiguration or an authentication problem. With each error reported below you will find explanation and guidance to help you to resolve it.

Once all the errors are resolved, semantic-release will release your package the next time you push a commit to the master branch. You can also manually restart the failed CI job that runs semantic-release.

If you are not sure how to resolve this, here is some links that can help you:

If those don’t help, or if this issue is reporting something you think isn’t right, you can always ask the humans behind semantic-release.


The push permission to the Git repository is required.

semantic-release cannot push the version tag to the branch master on remote Git repository.

Please refer to the authentication configuration documentation to configure the Git credentials on your CI environment.


Good luck with your project ✨

Your semantic-release bot 📦🚀

onSwatchHover Doesn't Work

onSwatchHover never triggers anything regardless of what you place inside it. Nor is it documented anywhere on how to execute it.

<color-twitter *ngIf="editColor" (onChangeComplete)="editColor = !editColor; eventColor=$event.color.hex" (onSwatchHover)="swatchHover($color, $event)" class="animated fadeIn"></color-twitter>

Popup functionality

Is it possible that in the future you will add a possibility to open the color picker as a popup, just by pressing the button?

ERROR in The target entry-point "ngx-color/sketch" has missing dependencies: - @angular/common - @angular/core

Angular CLI: 8.2.0
Node: 12.17.0
OS: win32 x64
Angular: undefined
...

Package                      Version
------------------------------------------------------
@angular-devkit/architect    0.802.0 (cli-only)
@angular-devkit/core         8.2.0 (cli-only)
@angular-devkit/schematics   8.2.0 (cli-only)
@schematics/angular          8.2.0 (cli-only)
@schematics/update           0.802.0 (cli-only)

Why am I receveing this?

ERROR in The target entry-point "ngx-color/sketch" has missing dependencies:
 - @angular/common
 - @angular/core

Add custom label for Buttons and preview labels

Hi,
Among all the components, the photoshop component meets our requirements and it would be much better if you can provide customization of labels for buttons and fields for multi-language support. I will pass the label property as a parameter. There are four labels in the photoshop component(i,e Ok, Cancel, new and current) that require multi-language support and it would be good if we get this feature.

FYI,
image

Thank you

Incorrect [color] input type

First, thank you for your work on this library :)

I noticed the variable type for the [color] input on the ColorWrap component is HSLA.

The documentation says that the input accepts hex strings, RGBA, HSLA or HSVA.

In practice, the input does indeed accept all types but typescript warns about the incompatibility.

Support for SSR (Angular Universal)

First of all, thank you for this great library. It works great in normal mode, but fails while running on SSR mode via angular universal.

The error i get is:
Event is not defined
on
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__metadata"])("design:paramtypes", [Event, Number, Number, Object]),
This error occurs after webpack compilation.

It would be great if this issue is fixed.

Preset Colors Title

want to change the preset tooltip but still shows the hex value, please advice on a workaround or if a fix is available.

presetColors.push({ color: hexColor, title: r:${color.r} g:${color.g} b:${color.b} a:${color.a} });

Simple Shade Slider

Hi, I would like to suggest a new feature for the color slider, this is a simple shade slider. this is just like a hue slider but the start color is the selected color from hue slider going to a darker color
Capture

angular5 support

hello,

is this module expected to work on angular5?

i got this exception

Uncaught Error: Unexpected value 'ColorSketchModule' imported by the module 'AppModule'. Please add a @NgModule annotation.

not sure if it's for angular5 or for something stupid that i do :)

When an empty array is given for presets, the preset-colors box has a floating border within the This occurs when using the SketchComponent

Hey,

image

As you can tell from this image, with no presets given, there is a free border. The issue comes from the fact that the div sketch-swatches inside the SketchPresetColorsComponent has margin and padding applied to it.

I expect that with no preset colours, we would not see a border.

An easy solution is to just add *ngIf="colors && colors.length" to the div or do something similar a level up.

I couldn't find any contribution guides on the repo, so I've logged the issue. If you instead rather I make a pull request, let me know and I can go down that road. Just let me know what guidelines to follow.

Thanks,

Usage with input and append to body

Great library, looks really good.

I have two questions:

  1. How can I use it with input, I mean when I click on input the picker needs to be shown next to it.
  2. There is an option to append it to the body element? The idea is to use it with elements with overflow hidden.

Thanks.

circleSize and circleSpacing not working on color-circle

Hi!, I tried to resize a circle with circleSize property but it didn't work, circleSpacing too.

<color-circle [colors]="defaultColorPicker" width="100%" circleSize="36" circleSpacing="10" (onChange)="handleChangeColor($event)"></color-circle>

And I think the problem in template of circle.component.ts, you din't pass circleSize and circleSpacing properties into color-circle-swatch
image

Get hex + alpha

Is it possible to retrieve the alpha value when using color.hex on ColorEvent?

it would be better than doing

let hexValue = colorEvent.color.hex || '';
  if (hexValue.length === 7) {
    hexValue += Math.round(colorEvent.color.rgb.a * 255).toString(16);
}

Modify css circle picker

How can I modfiy the CSS of the circle picker in order to center the circles? Because I'm trying to override it and nothing happens. Could you help me? I want to adapt it to my design.
Thanks.

Cannot read property 'kind' of undefined while ng build --prod

I am getting the following error while building my angular app for production.
Running ng serve does not produce any error

ERROR in /Users/ashok/WebRoot/sociostuff/node_modules/ngx-color/fesm5/ngx-color.js
Module build failed (from /Users/ashok/WebRoot/sociostuff/node_modules/@angular-devkit/build-optimizer/src/build-optimizer/webpack-loader.js):
TypeError: Cannot read property 'kind' of undefined
    at isAngularDecoratorMetadataExpression (/Users/ashok/WebRoot/sociostuff/node_modules/@angular-devkit/build-optimizer/src/transforms/scrub-file.js:265:35)
    at checkNodeForDecorators (/Users/ashok/WebRoot/sociostuff/node_modules/@angular-devkit/build-optimizer/src/transforms/scrub-file.js:77:21)
    at visitNodes (/Users/ashok/WebRoot/sociostuff/node_modules/typescript/lib/typescript.js:16144:30)
    at Object.forEachChild (/Users/ashok/WebRoot/sociostuff/node_modules/typescript/lib/typescript.js:16370:24)
    at checkNodeForDecorators (/Users/ashok/WebRoot/sociostuff/node_modules/@angular-devkit/build-optimizer/src/transforms/scrub-file.js:68:31)
    at visitNode (/Users/ashok/WebRoot/sociostuff/node_modules/typescript/lib/typescript.js:16135:24)
    at Object.forEachChild (/Users/ashok/WebRoot/sociostuff/node_modules/typescript/lib/typescript.js:16265:21)
    at checkNodeForDecorators (/Users/ashok/WebRoot/sociostuff/node_modules/@angular-devkit/build-optimizer/src/transforms/scrub-file.js:68:31)
    at visitNode (/Users/ashok/WebRoot/sociostuff/node_modules/typescript/lib/typescript.js:16135:24)
    at Object.forEachChild (/Users/ashok/WebRoot/sociostuff/node_modules/typescript/lib/typescript.js:16322:24)
    at checkNodeForDecorators (/Users/ashok/WebRoot/sociostuff/node_modules/@angular-devkit/build-optimizer/src/transforms/scrub-file.js:68:31)
    at visitNode (/Users/ashok/WebRoot/sociostuff/node_modules/typescript/lib/typescript.js:16135:24)
    at Object.forEachChild (/Users/ashok/WebRoot/sociostuff/node_modules/typescript/lib/typescript.js:16333:24)
    at checkNodeForDecorators (/Users/ashok/WebRoot/sociostuff/node_modules/@angular-devkit/build-optimizer/src/transforms/scrub-file.js:68:31)
    at visitNode (/Users/ashok/WebRoot/sociostuff/node_modules/typescript/lib/typescript.js:16135:24)
    at Object.forEachChild (/Users/ashok/WebRoot/sociostuff/node_modules/typescript/lib/typescript.js:16229:21)
ERROR in /Users/ashok/WebRoot/sociostuff/node_modules/ngx-color/circle/fesm5/ngx-color-circle.js
Module build failed (from /Users/ashok/WebRoot/sociostuff/node_modules/@angular-devkit/build-optimizer/src/build-optimizer/webpack-loader.js):

Versions of packages from package.json

"@angular/animations": "~7.2.0",
"@angular/cdk": "^7.2.0",
"@angular/common": "~7.2.0",
"@angular/compiler": "~7.2.0",
"@angular/core": "~7.2.0",
"@angular/forms": "~7.2.0",
"@angular/http": "~7.2.0",
"@angular/platform-browser": "~7.2.0",
"@angular/platform-browser-dynamic": "~7.2.0",
"@angular/platform-server": "~7.2.0",
"@angular/router": "~7.2.0",
"ngx-color": "^5.1.1",

Override default selected color after initialization

This is not a bug, this is 2 requests:

  1. Once you've created color component (e.g.: color-sketch), I am unable to override programmatically it's value, because seems like "[color]" input parameter seems like one way binded, it doesn't care the color object has changed on parent even if I try to send like this: "[(color)]".

  2. Is it possible to modify preset colors somehow? If not please can you put that in?

Thanks

TypeError: Object(...) is not a function in ngx-color.js:895

Hello there,
I am getting some errors with the basic implementation of this component.

I'm using:

Ionic Framework: 3.9.2
Ionic App Scripts: 3.1.8
Angular Core: 5.2.9
Angular Compiler CLI: 5.2.9
Node: 9.11.1
OS Platform: macOS Sierra
Navigator Platform: MacIntel
User Agent: Mozilla/5.0 (Linux; Android 5.0; SM-G900P Build/LRX21T) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.181 Mobile Safari/537.36

First I tried <color-slider></color-slider> (with and without color and (onChange) set) and got an exception every time I clicked in the slider, and of course, couldn't drag the slider itself.

Then I tried <color-alpha-picker></color-alpha-picker>, got the same exception that occurs in this part of the code (line 895 of ngx-color.js):

  this.mousemove = fromEvent(document, 'mousemove')
            .subscribe(function (e) { return _this.handleMousemove(e); });

It seems that fromEvent object is not defined.

When I finally tried <color-sketch></color-sketch> I still got the same exception, but only when clicked in the two bottom sliders.

Would love if you could give any hint to help me solve this problem.

Thanks in advance

HueComponent direction vertical does not account for slider

When using HueComponent with direction vertical, the default slider/pointer css is not adjusted.

Work around is to pass in a custom 'pointer'. If vertical is an out of the box option should a default slider for the vertical hue also be included.

Must call super constructor in derived class before accessing 'this' or returning from derived constructor

Hey, when I include your color picker in my angular project, I get the following error:

Must call super constructor in derived class before accessing 'this' or returning from derived constructor

This error only occurs on a live server. When compiling on my local machine, I donot see this error, only when compliling and upload via ftp.

In my app.module.ts I import the ColorCircleModule like so

import { ColorCircleModule } from 'ngx-color/circle';

then import it like:

imports: [ColorCircleModule]

and use it like so

<color-circle width="120px" [colors]="wallColors" circleSize="30" circleSpacing="5" (onChangeComplete)="setWallColor($event)"></color-circle>

where wallColors is a array of strings

private wallColors: string[] = ['#e6e1c9', '#b34a59', '#...']

Aria compliancy (508)

I'm looking for a good color picker that is aria compliant. This looks to be one of the best pickers but I'm not seeing any compliancy. Don't take this bad, I haven't found one that is.

I'm looking to use the slacker interface but haven't looked at the code too much. Would it e easier to make a new component that is Aria compliant? It would need to add aria roles and attributes to html tags, change the way tab works and use of arrow keys for selections and space/enter to select.

If no thoughts have been on this topic and the above would work, I could look at doing the new component.

The automated release is failing 🚨

🚨 The automated release from the master branch failed. 🚨

I recommend you give this issue a high priority, so other packages depending on you could benefit from your bug fixes and new features.

You can find below the list of errors reported by semantic-release. Each one of them has to be resolved in order to automatically publish your package. I’m sure you can resolve this 💪.

Errors are usually caused by a misconfiguration or an authentication problem. With each error reported below you will find explanation and guidance to help you to resolve it.

Once all the errors are resolved, semantic-release will release your package the next time you push a commit to the master branch. You can also manually restart the failed CI job that runs semantic-release.

If you are not sure how to resolve this, here is some links that can help you:

If those don’t help, or if this issue is reporting something you think isn’t right, you can always ask the humans behind semantic-release.


The push permission to the Git repository is required.

semantic-release cannot push the version tag to the branch master on remote Git repository.

Please refer to the authentication configuration documentation to configure the Git credentials on your CI environment.


Good luck with your project ✨

Your semantic-release bot 📦🚀

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.