<commit_before>import Color from './color';
import Rgb   from './rgb';

const NAME = Symbol.for('YCbCr');
const KEYS = Object.freeze({
  Y:  Symbol.for('Y'),
  CB: Symbol.for('Cb'),
  CR: Symbol.for('Cr')
});

export default class YCbCr extends Color {
  constructor(y, cb, cr) {
    super(NAME, [[KEYS.Y, y], [KEYS.CB, cb], [KEYS.CR, cr]]);
  }

  clone() {
    return new YCbCr(...this.values());
  }

  rgb() {
    const [y, cb, cr] = this.values();

    const r = Math.round(y + (cr - 128) * 1.403);
    const g = Math.round(y - (cb - 128) * 0.344 - (cr - 128) * 0.714);
    const b = Math.round(y + (cb - 128) * 1.773);
    return new Rgb(r, g, b);
  }
}
<commit_msg>Implemented a method that converts color space to YCbCr<commit_after>import Color from './color';
import Rgb   from './rgb';

const NAME = Symbol.for('YCbCr');
const KEYS = Object.freeze({
  Y:  Symbol.for('Y'),
  CB: Symbol.for('Cb'),
  CR: Symbol.for('Cr')
});

export default class YCbCr extends Color {
  constructor(y, cb, cr) {
    super(NAME, [[KEYS.Y, y], [KEYS.CB, cb], [KEYS.CR, cr]]);
  }

  clone() {
    return new YCbCr(...this.values());
  }

  rgb() {
    const [y, cb, cr] = this.values();

    const r = Math.round(y + (cr - 128) * 1.403);
    const g = Math.round(y - (cb - 128) * 0.344 - (cr - 128) * 0.714);
    const b = Math.round(y + (cb - 128) * 1.773);
    return new Rgb(r, g, b);
  }

  ycbcr() {
    return self;
  }
}

{'fraction_non_alphanumeric': 0.20774647887323944, 'fraction_numerical': 0.03943661971830986, 'mean_word_length': 2.652956298200514, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '51069', 'n_tokens_mistral': 632, 'n_tokens_neox': 571, 'n_words': 155}