<commit_before>import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';
import { ActivatedRoute } from '@angular/router';

@Component({
    selector: 'color-picker',
    templateUrl: './colorPicker.html',
})
export class ColorPickerComponent implements OnInit {

    @Input() public width: string;
    @Input() public height: string;
    @Input() public canvas: any;
    @Input() public small: boolean;

    @Output() public ignoreMove: EventEmitter<any> = new EventEmitter();

    public zoom = {

        ignoreParentMove: false,    // used to text selection by mouse of color hex,rgb,hsl
        srcPixelRadius: 3,
        zoomPixelSize: 8,           // center pixel max size (in pixels)

        colorCenterPixel: [0, 0, 0, 255],
        colorSelected: [0, 0, 0, 255],
        colorSelectedHex: '#000000ff',
        colorSelectedRgba: 'rgba(0, 0, 0, 1)',
        colorSelectedHsla: 'hsl(0, 0%, 0%, 1)',

        factor: 10,
        canvas: null,
        zoomedCanvas: null,
        zoomeDataUrl: '',

        selectedPixel: {
            x: 0,
            y: 0,
        }
    };

    constructor(private _route: ActivatedRoute) {}

    public ngOnInit() {

        this.initCanvasAndZoom();
        this.zoomPixel(0, 0);
    }

    public ignoreHintClick(event) {

        this.ignoreMove.emit(event);
    }

    public zoomPixel(x, y) {

        this.zoom.selectedPixel.x = x;
        this.zoom.selectedPixel.y = y;
        this.zoomReadPixels(x, y, this.zoom.srcPixelRadius);
    }

    public zoomPixelShift(shiftX, shiftY) {

        this.zoom.selectedPixel.x += shiftX;
        this.zoom.selectedPixel.y += shiftY;
        this.zoomPixel(this.zoom.selectedPixel.x, this.zoom.selectedPixel.y);
    }

    public selectColor() {
        this.zoom.colorSelected = this.zoom.colorCenterPixel;
        
        let [r, g, b, a] = this.zoom.colorSelected;
        this.zoom.colorSelectedRgba = 'rgba(' + r + ', ' + g + ', ' + b + ', ' + (a / 255) + ')';
        this.zoom.colorSelectedHex = this.rgbaToHex(r, g, b, a);
        this.zoom.colorSelectedHsla = this.rgbToHsl(r, g, b, a);
    }<commit_msg>test change<commit_after>import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';
import { ActivatedRoute } from '@angular/router';

@Component({
    selector: 'color-picker',
    templateUrl: './colorPicker.html',
})
export class ColorPickerComponent implements OnInit {

    @Input() public width: string;
    @Input() public height: string;
    @Input() public canvas: any;
    @Input() public small: boolean;

    @Output() public ignoreMove: EventEmitter<any> = new EventEmitter();

    public zoom = {

        ignoreParentMove: false,    // used to text selection by mouse of color hex,rgb,hsl
        srcPixelRadius: 3,
        zoomPixelSize: 8,           // center pixel max size (in pixels)

        colorCenterPixel: [0, 0, 0, 255],
        colorSelected: [0, 0, 0, 255],
        colorSelectedHex: '#000000ff',
        colorSelectedRgba: 'rgba(0, 0, 0, 1)',
        colorSelectedHsla: 'hsl(0, 0%, 0%, 1)',

        factor: 10,
        canvas: null,
        zoomedCanvas: null,
        zoomeDataUrl: '',

        selectedPixel: {
            x: 0,
            y: 0,
        }
    };

    constructor(private _route: ActivatedRoute) {}

    public ngOnInit() {

        this.initCanvasAndZoom();
        this.zoomPixel(0, 0);
    }

    public ignoreHintClick(event) {

        this.ignoreMove.emit(event);
    }

    public zoomPixel(x, y) {

        this.zoom.selectedPixel.x = x;
        this.zoom.selectedPixel.y = y;
        this.zoomReadPixels(x, y, this.zoom.srcPixelRadius);
    }

    public zoomPixelShift(shiftX, shiftY) {

        this.zoom.selectedPixel.x += shiftX;
        this.zoom.selectedPixel.y += shiftY;
        this.zoomPixel(this.zoom.selectedPixel.x, this.zoom.selectedPixel.y);
    }

    public selectColor() {
        this.zoom.colorSelected = this.zoom.colorCenterPixel;

        let [r, g, b, a] = this.zoom.colorSelected;
        this.zoom.colorSelectedRgba = 'rgba(' + r + ', ' + g + ', ' + b + ', ' + (a / 255) + ')';
        this.zoom.colorSelectedHex = this.rgbaToHex(r, g, b, a);
        this.zoom.colorSelectedHsla = this.rgbToHsl(r, g, b, a);
    }
{'fraction_non_alphanumeric': 0.13666352497643733, 'fraction_numerical': 0.017436380772855798, 'mean_word_length': 2.4014423076923075, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6437519', 'n_tokens_mistral': 1425, 'n_tokens_neox': 1332, 'n_words': 317}