mirror of
https://github.com/Ku6epXBOCTuK/easy-png-tools.git
synced 2026-11-13 17:08:20 +00:00
chore: clear lint rules warns: comments, tests
This commit is contained in:
@@ -3,7 +3,7 @@ import { createPixelImage } from "./types";
|
||||
import { rgbToHsl } from "./palette";
|
||||
import type { Rgb } from "./palette";
|
||||
|
||||
/** Все компоненты нормализованы в 0..1 в порядке объявления. */
|
||||
/** All components normalized to 0..1 in declaration order. */
|
||||
export type SpaceComponents = number[];
|
||||
|
||||
export type SpaceId = "hsl" | "hsv" | "hsi" | "cmyk" | "ycbcr" | "lab";
|
||||
@@ -75,7 +75,7 @@ function rgbToLab({ r, g, b }: Rgb): [number, number, number] {
|
||||
const fx = f(x);
|
||||
const fy = f(y);
|
||||
const fz = f(z);
|
||||
// L нормирован 0..1; a/b центрированы на 0.5 с размахом ±0.5
|
||||
// L normalized to 0..1; a/b centered at 0.5 with +-0.5 range
|
||||
return [
|
||||
(116 * fy - 16) / 100,
|
||||
(500 * (fx - fy)) / 250 + 0.5,
|
||||
@@ -106,9 +106,9 @@ export const SPACES: Record<SpaceId, SpaceDef> = {
|
||||
export type ChannelDisplay = "gray" | "color";
|
||||
|
||||
/**
|
||||
* Визуализация выбранного пространства: каждый компонент пространства
|
||||
* попадает в свой канал результата (mode 'color') или выбранный компонент
|
||||
* рисуется градациями серого (mode 'gray').
|
||||
* Visualizes the selected space: each component goes to its own result
|
||||
* channel (mode 'color'), or the selected component is drawn in grayscale
|
||||
* (mode 'gray').
|
||||
*/
|
||||
export function renderSpace(
|
||||
img: PixelImage,
|
||||
|
||||
Reference in New Issue
Block a user