aseprite/tests/scripts/color_space.lua

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

22 lines
569 B
Lua
Raw Normal View History

2019-01-04 00:51:30 +08:00
-- Copyright (C) 2019 Igara Studio S.A.
--
-- This file is released under the terms of the MIT license.
-- Read LICENSE.txt for more information.
2019-01-04 02:32:45 +08:00
local none = ColorSpace() -- None
2020-07-29 04:44:31 +08:00
local srgb = ColorSpace{ sRGB=true }
local none2 = ColorSpace{ sRGB=false }
2019-01-04 02:32:45 +08:00
assert(none ~= srgb)
2020-07-29 04:44:31 +08:00
assert(none == none2)
2019-01-04 00:52:13 +08:00
2019-01-04 02:32:45 +08:00
local spr = Sprite(32, 32)
local cs1 = spr.colorSpace
2019-01-04 00:52:13 +08:00
local cs2 = spr.spec.colorSpace
2019-01-04 02:32:45 +08:00
assert(cs1 == cs2)
assert(cs1 ~= none)
assert(cs1 == srgb) -- Default color profile: sRGB
2019-01-04 02:32:45 +08:00
local spr3 = Sprite(32, 32)
local cs3 = spr.spec.colorSpace
assert(cs1 == cs3)