mirror of
https://github.com/Ku6epXBOCTuK/easy-png-tools.git
synced 2026-09-14 21:46:35 +00:00
feat: add core operations
This commit is contained in:
@@ -1,7 +1,14 @@
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import { colorMask, flattenOntoColor, parseHex, removeColorToAlpha } from './alpha';
|
||||
import { colorMask, flattenOntoColor, invertAlpha, parseHex, removeColorToAlpha } from './alpha';
|
||||
import { makeImage } from './test-helpers';
|
||||
|
||||
describe('invertAlpha', () => {
|
||||
it('обращает альфу, RGB не трогает', () => {
|
||||
const out = invertAlpha(makeImage(1, 1, [[10, 20, 30, 128]]));
|
||||
expect([...out.data]).toEqual([10, 20, 30, 127]);
|
||||
});
|
||||
});
|
||||
|
||||
describe('removeColorToAlpha', () => {
|
||||
const fixture = () =>
|
||||
makeImage(2, 1, [
|
||||
|
||||
Reference in New Issue
Block a user