🌟現在、鉄壁 鉄壁ヘッドショットには対応済みです。
鉄壁HSは通常HSと同じダメージになります。LMG及びDMR、チャージライフル、ハンマーポイント弾を除き、すべてのダメージ値が一致していることを確認しています。

モジュール:Color

提供:Apex Data
ナビゲーションに移動 検索に移動

このモジュールについての説明文ページを モジュール:Color/doc に作成できます

--[[
  Color Library (subset) for MediaWiki
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  Copyright (C) 2022 mntone. All rights reserved.
  This script is released under the MIT License.
]]
local aw = require('Module:Utility/Library')

local Color = {
	HSL = {},
	RGB = {},
}

-- === [ Class: RGB ]
local function __Color_RGB_tostring(p)
	local r = aw.round(255 * p.red)
	local g = aw.round(255 * p.green)
	local b = aw.round(255 * p.blue)
	return string.format('#%02X%02X%02X', r, g, b)
end

local __Color_RGB_instance = {
	__index    = Color.RGB,
	__tostring = __Color_RGB_tostring,
}

function Color.RGB.clone(self)
	return Color.RGB(self.red, self.green, self.blue)
end

local function __Color_RGB_init(that, r, g, b)
	local obj = setmetatable({
		red   = r,
		green = g,
		blue  = b,
	}, __Color_RGB_instance)
	return obj
end
setmetatable(Color.RGB, {__call = __Color_RGB_init})
-- ===

-- === [ Class: HSL ]
local function __Color_HSL_tostring(p)
	local h = aw.round(360 * p.hue)
	local s = aw.round(100 * p.saturation)
	local l = aw.round(100 * p.lightness)
	return string.format('hsl(%d, %d%%, %d%%)', h, s, l)
end

local __Color_HSL_instance = {
	__index    = Color.HSL,
	__tostring = __Color_HSL_tostring,
}

function Color.HSL.clone(self)
	return Color.HSL(self.hue, self.saturation, self.lightness)
end

local function hsl2v(l, z, h)
	if h < 1/6 then
		return (l - z) + 12 * z * h
	elseif h < 3/6 then
		return l + z
	elseif h < 4/6 then
		return (l - z) + 12 * z * (2/3 - h)
	else
		return l - z
	end
end

local function hsl2rgb(h, s, l)
	local z
	if l < 0.5 then
		z = s * l
	else
		z = s * (1 - l)
	end
	return
		hsl2v(l, z, h >= 2/3 and h - 2/3 or h + 1/3),
		hsl2v(l, z, h),
		hsl2v(l, z, h < 1/3 and h + 2/3 or h - 1/3)
end

function Color.HSL.toRGB(self)
	local r, g, b = hsl2rgb(self.hue, self.saturation, self.lightness)
	return Color.RGB(r, g, b)
end

local function __Color_HSL_init(that, h, s, l)
	local obj = setmetatable({
		hue        = h,
		saturation = s,
		lightness  = l,
	}, __Color_HSL_instance)
	return obj
end
setmetatable(Color.HSL, {__call = __Color_HSL_init})
-- ===

return Color