黄瓜和什么一起炒好吃| 火龙果是什么颜色| 否认是什么意思| 0是什么意思网络语言| 什么不动| 扁平足看什么科| 肾阳虚有什么症状男性| 右膝关节退行性变是什么意思| 夜间胃痛是什么原因| 蓁字五行属什么| 什么是假声| 心率快吃什么药效果更佳| 嘴唇发黑是什么原因引起的| 做恐怖的梦预示着什么| 未病是什么意思| 老头晕是什么原因引起的| 为什么会得尿道炎| 较重闭合性跌打损伤是什么意思| 眼睛肿是什么问题| 舌头口腔溃疡是什么原因引起的| 喝水都长肉是什么原因| dm代表什么| 右肺上叶钙化灶是什么意思| 屁眼火辣辣的疼是什么原因| 精华液是干什么用的| 明年是什么年| 子宫粘连有什么症状| 东北有什么特产| 的字五行属什么| 相濡以沫什么意思| 胡萝卜不能和什么一起吃| 切痣挂什么科| 肛门是什么| 羊水穿刺检查什么| 吃饭咬到舌头什么原因| 惊恐症是什么病| 淋巴净排是什么服务| 视功能是什么| 梅长苏是什么电视剧| 黑加京念什么| 眼睛总是干涩是什么原因| 把子肉是什么| 粉红粉红的什么填空| 一见如什么| 舌头紫红色是什么原因| 溃疡用什么药| 胃镜挂什么科| 海螵蛸是什么东西| 茄子什么人不能吃| 打胶原蛋白针有什么副作用吗| 紫癜是什么原因引起的| 血小板减少吃什么药| 什么动物没有耳朵| 茶水洗脸有什么好处和坏处| 什么克水| hp-是什么意思| 鼻咽炎有什么症状| 小孩长得慢是什么原因| 望眼欲穿什么意思| 近视是什么原因造成的| 隔离霜是干什么用的| 什么血型的人招蚊子| 咽喉炎吃什么药好得快| 尿道口感染吃什么药| b是什么| 脑垂体挂什么科| 外阴苔藓用什么药膏| mds是什么意思| 妈妈的表妹叫什么| 经是什么意思| 配子是什么| 二杠四星是什么军衔| 还是什么意思| 阴阳两虚是什么症状| 阿耨多罗三藐三菩提是什么意思| ce是什么意思| 万事如意是什么生肖| 金牛座属于什么象星座| 前列腺肥大是什么症状| 红斑狼疮是什么引起的| 一拃长是什么意思| 人生八苦是什么| 宝宝吃什么鱼比较好| 初音未来是什么| 总蛋白高是什么原因| 水煎服是什么意思| 支原体吃什么药| esr是什么| 总是放屁是什么原因引起的| 四肢肿胀是什么原因引起的| aq是什么标准| 故意不接电话说明什么| 父亲节送什么| 女人为什么会得霉菌| 梅花代表什么象征意义| 呼吸短促是什么原因| 喝什么醒酒| 太阳是什么颜色的| 哆啦a梦的口袋叫什么| 什么分泌胰岛素| 杆鱼是什么鱼| 身上痒是什么原因引起的| 12月24号是什么星座| 什么是追溯码| 急性结膜炎用什么眼药水| 公子是你吗是什么歌| 恶心吃什么药| 自然色是什么颜色| 柬埔寨有什么特产| 白色情人节什么意思| 尿液浑浊是什么原因| 股癣是什么原因引起的| 尔昌尔炽什么意思| 鸡胗是什么部位| 肚子疼去医院挂什么科| 吃什么药升血小板最快| 台甫是什么意思| 女为读什么| 干咳 吃什么药| davena手表什么牌子| ppada是什么牌子| 一字之师是什么意思| 大脑记忆力下降是什么原因| absolue是兰蔻的什么产品| 肤专家抑菌软膏主要治什么| 卧虎藏龙是什么生肖| 久卧伤什么| 籍贯是指什么| 蛋黄吃多了有什么坏处| acei是什么意思| 一月十八是什么星座| 做梦梦见钓鱼是什么意思| 冬天用什么沐浴露好| 等闲之辈是什么意思| 痦子是什么| 打疫苗挂什么科| 阴囊潮湿是什么原因造成的| 金钱能买来什么但买不来什么| 什么颜色的床单有助于睡眠| 做穿刺是什么意思| 马为什么不怕蛇毒| 6月14号什么星座| 政客是什么意思| 坎宅是什么意思| 早上起床牙龈出血是什么原因| 光谱是什么| 吃什么食物补脾虚| hba是什么意思| 插入阴道什么感觉| 解脲脲原体是什么病| 梦见下雪是什么征兆| 一什么玉米| 西游记是一部什么小说| 副高是什么级别| 高良姜是什么姜| 09年属什么生肖| 六小龄童的真名叫什么| 介质是什么| 屁股骨头疼是什么原因| 去美容院洗脸有什么好处| 7777什么意思| 什么可以代替狗狗沐浴露| 夸父为什么要追赶太阳| 眼睛痛用什么药| 送什么礼物给孩子| 酸菜炒什么好吃| 为什么会得人工荨麻疹| 太阳星座是什么意思| 亮丽是什么意思| mr是什么意思| 粉瘤不切除有什么危害| 什么行业最赚钱投资小| 房中术是什么意思| 威化是什么意思| 清心寡欲是什么意思| 阴道炎是什么原因引起的| 我国的国花是什么| 身份证号最后一位代表什么| 胃粘膜糜烂吃什么药| 起酥油是什么油| 物质是由什么组成的| 黄色五行属什么| 唐筛是什么意思| 狗女和什么属相最配| 血液病是什么病| 热退疹出是什么病| 经常想睡觉是什么原因| 减肥吃什么油| 经常流鼻涕是什么原因| 牙龈经常出血是什么原因| 幼儿园转学需要什么手续| 咖色搭配什么颜色好看| 腰椎痛用什么药| 梦到吃屎是什么意思| 逝者如斯夫是什么意思| 来源朋友验证消息是什么意思| 足及念什么| 风寒吃什么感冒药| 阿胶配什么吃不上火| 四大发明是什么| 小腹左侧疼是什么原因| 梦见虫子是什么意思| 康什么大道| 张靓颖什么星座| 痛苦的反义词是什么| 挂彩是什么意思| 画风是什么意思| 什么地找| 法盲是什么意思| tg什么意思| 六月不搬家是什么意思| 凡士林是什么东西| 羊传染人的病叫什么名| 网络维护是做什么的| 什么药膏能让疣体脱落| 1980属什么生肖| 桑葚有什么功效| 身上长小红点是什么原因| 买车置换是什么意思| 脚气用什么药| 脸上白了一小块是什么原因| 怀孕挂什么科| 郑声是什么意思| 为什么拍照脸是歪的| cfa是什么证书| 囊肿和肿瘤有什么区别| 口干口苦挂什么科| 寸止什么意思| 前庭是什么意思| 哭得什么| 万象更新是什么生肖| 拉黑一个人意味着什么| 陶字五行属什么| 红细胞减少是什么原因| 渝北区有什么好玩的地方| 面首是什么| 反胃酸是什么原因| 线索是什么意思| 坐月子什么不可以吃| 起什么转什么成语| 肚子胀是什么原因| 7月20号是什么星座| lagogo是什么牌子| 射手属于什么象星座| 经常流鼻涕是什么原因引起的| 何炅的老婆叫什么名字| brooks是什么品牌| 假酒喝了有什么症状| 尿频尿急尿不尽吃什么药| 3岁宝宝流鼻血是什么原因| 患难见真情的上一句是什么| 有时候会感到莫名的难过是什么歌| 三焦不通吃什么中成药| 玻尿酸面膜有什么功效| 什么移动卡流量多| 十月初四是什么星座| 2001年属什么| 三合是什么意思| 花胶是什么鱼的鱼肚| 肝实质弥漫性回声改变什么意思| 结扎对男的有什么影响| 女性私下有苦味主要是什么原因| 小康生活的标准是什么| 红蜘蛛用什么药| 百度跳至內容

眉州东坡总裁梁棣:未来10年,创始人得做企业服务员

Chók-cê?? Wikipedia
百度 凤凰网致力于给“冰冷”的技术注入温暖的人文关怀,以彰显永恒不灭的价值理性。

可在模組:Color contrast/doc建立此模組的說明文件

--
-- This module implements
--  {{Color contrast ratio}}
--  {{Greater color contrast ratio}}
--  {{ColorToLum}}
--  {{RGBColorToLum}}
--
local p = {}
local HTMLcolor = mw.loadData( 'Module:Color contrast/colors' )

local function sRGB (v)
	if (v <= 0.03928) then
		v = v / 12.92
	else
		v = math.pow((v+0.055)/1.055, 2.4)
	end
	return v
end

local function rgbdec2lum(R, G, B)
	if ( 0 <= R and R < 256 and 0 <= G and G < 256 and 0 <= B and B < 256 ) then
		return 0.2126 * sRGB(R/255) + 0.7152 * sRGB(G/255) + 0.0722 * sRGB(B/255)
	else
		return ''
	end
end

local function hsl2lum(h, s, l)
	if ( 0 <= h and h < 360 and 0 <= s and s <= 1 and 0 <= l and l <= 1 ) then
		local c = (1 - math.abs(2*l - 1))*s
		local x = c*(1 - math.abs( math.fmod(h/60, 2) - 1) )
		local m = l - c/2

		local r, g, b = m, m, m
		if( 0 <= h and h < 60 ) then
			r = r + c
			g = g + x
		elseif( 60 <= h and h < 120 ) then
			r = r + x
			g = g + c
		elseif( 120 <= h and h < 180 ) then
			g = g + c
			b = b + x
		elseif( 180 <= h and h < 240 ) then
			g = g + x
			b = b + c
		elseif( 240 <= h and h < 300 ) then
			r = r + x
			b = b + c
		elseif( 300 <= h and h < 360 ) then
			r = r + c
			b = b + x
		end
		return rgbdec2lum(255*r, 255*g, 255*b)
	else
		return ''
	end
end

local function color2lum(c)

	if (c == nil) then
		return ''
	end

	-- html '#' entity
	c = c:gsub("&#35;", "#")

	-- whitespace
	c = c:match( '^%s*(.-)[%s;]*$' )

	-- unstrip nowiki strip markers
	c = mw.text.unstripNoWiki(c)

	-- lowercase
	c = c:lower()

	-- first try to look it up
	local L = HTMLcolor[c]
	if (L ~= nil) then
		return L
	end

	-- convert from hsl
	if mw.ustring.match(c,'^hsl%([%s]*[0-9][0-9%.]*[%s]*,[%s]*[0-9][0-9%.]*%%[%s]*,[%s]*[0-9][0-9%.]*%%[%s]*%)$') then
		local h, s, l = mw.ustring.match(c,'^hsl%([%s]*([0-9][0-9%.]*)[%s]*,[%s]*([0-9][0-9%.]*)%%[%s]*,[%s]*([0-9][0-9%.]*)%%[%s]*%)$')
		return hsl2lum(tonumber(h), tonumber(s)/100, tonumber(l)/100)
	end

	-- convert from rgb
	if mw.ustring.match(c,'^rgb%([%s]*[0-9][0-9]*[%s]*,[%s]*[0-9][0-9]*[%s]*,[%s]*[0-9][0-9]*[%s]*%)$') then
		local R, G, B = mw.ustring.match(c,'^rgb%([%s]*([0-9][0-9]*)[%s]*,[%s]*([0-9][0-9]*)[%s]*,[%s]*([0-9][0-9]*)[%s]*%)$')
		return rgbdec2lum(tonumber(R), tonumber(G), tonumber(B))
	end

	-- convert from rgb percent
	if mw.ustring.match(c,'^rgb%([%s]*[0-9][0-9%.]*%%[%s]*,[%s]*[0-9][0-9%.]*%%[%s]*,[%s]*[0-9][0-9%.]*%%[%s]*%)$') then
		local R, G, B = mw.ustring.match(c,'^rgb%([%s]*([0-9][0-9%.]*)%%[%s]*,[%s]*([0-9][0-9%.]*)%%[%s]*,[%s]*([0-9][0-9%.]*)%%[%s]*%)$')
		return rgbdec2lum(255*tonumber(R)/100, 255*tonumber(G)/100, 255*tonumber(B)/100)
	end

	-- remove leading # (if there is one) and whitespace
	c = mw.ustring.match(c, '^[%s#]*([a-f0-9]*)[%s]*$')

	-- split into rgb
	local cs = mw.text.split(c or '', '')
	if( #cs == 6 ) then
		local R = 16*tonumber('0x' .. cs[1]) + tonumber('0x' .. cs[2])
		local G = 16*tonumber('0x' .. cs[3]) + tonumber('0x' .. cs[4])
		local B = 16*tonumber('0x' .. cs[5]) + tonumber('0x' .. cs[6])

		return rgbdec2lum(R, G, B)
	elseif ( #cs == 3 ) then
		local R = 16*tonumber('0x' .. cs[1]) + tonumber('0x' .. cs[1])
		local G = 16*tonumber('0x' .. cs[2]) + tonumber('0x' .. cs[2])
		local B = 16*tonumber('0x' .. cs[3]) + tonumber('0x' .. cs[3])

		return rgbdec2lum(R, G, B)
	end

	-- failure, return blank
	return ''
end

-- This exports the function for use in other modules.
-- The colour is passed as a string.
function p._lum(color)
	return color2lum(color)
end

function p._greatercontrast(args)
	local bias = tonumber(args['bias'] or '0') or 0
	local css = (args['css'] and args['css'] ~= '') and true or false
	local v1 = color2lum(args[1] or '')
	local c2 = args[2] or '#FFFFFF'
	local v2 = color2lum(c2)
	local c3 = args[3] or '#000000'
	local v3 = color2lum(c3)
	local ratio1 = -1;
	local ratio2 = -1;
	if (type(v1) == 'number' and type(v2) == 'number') then
		ratio1 = (v2 + 0.05)/(v1 + 0.05)
		ratio1 = (ratio1 < 1) and 1/ratio1 or ratio1
	end
	if (type(v1) == 'number' and type(v3) == 'number') then
		ratio2 = (v3 + 0.05)/(v1 + 0.05)
		ratio2 = (ratio2 < 1) and 1/ratio2 or ratio2
	end

	if css then
		local c1 = args[1] or ''
		if mw.ustring.match(c1, '^[A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9]$') or
			mw.ustring.match(c1, '^[A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9]$') then
				c1 = '#' .. c1
		end
		if mw.ustring.match(c2, '^[A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9]$') or
			mw.ustring.match(c2, '^[A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9]$') then
				c2 = '#' .. c2
		end
		if mw.ustring.match(v3, '^[A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9]$') or
			mw.ustring.match(v3, '^[A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9]$') then
				c3 = '#' .. c3
		end
		return 'background-color:' .. c1 .. '; color:' .. ((ratio1 > 0) and (ratio2 > 0) and ((ratio1 + bias > ratio2) and c2 or c3) or '') .. ';'
	end

	return (ratio1 > 0) and (ratio2 > 0) and ((ratio1 + bias > ratio2) and c2 or c3) or ''
end

function p._ratio(args)
	local v1 = color2lum(args[1])
	local v2 = color2lum(args[2])
	if (type(v1) == 'number' and type(v2) == 'number') then
		-- v1 should be the brighter of the two.
		if v2 > v1 then
			v1, v2 = v2, v1
		end
		return (v1 + 0.05)/(v2 + 0.05)
	else
		return args['error'] or '?'
	end
end

function p._styleratio(args)
	local style = (args[1] or ''):lower()
	local bg, fg = 'white', 'black'
	local lum_bg, lum_fg = 1, 0

	if args[2] then
		local lum = color2lum(args[2])
		if lum ~= '' then bg, lum_bg = args[2], lum end
	end
	if args[3] then
		local lum = color2lum(args[3])
		if lum ~= '' then fg, lum_fg = args[3], lum end
	end

	local slist = mw.text.split(mw.ustring.gsub(mw.ustring.gsub(style or '', '&#[Xx]23;', '#'), '&#35;', '#'), ';')
	for k = 1,#slist do
		local s = slist[k]
		local k,v = s:match( '^[%s]*([^:]-):([^:]-)[%s;]*$' )
		k = k or ''
		v = v or ''
		if (k:match('^[%s]*(background)[%s]*$') or k:match('^[%s]*(background%-color)[%s]*$')) then
			local lum = color2lum(v)
			if( lum ~= '' ) then bg, lum_bg = v, lum end
		elseif (k:match('^[%s]*(color)[%s]*$')) then
			local lum = color2lum(v)
			if( lum ~= '' ) then bg, lum_fg = v, lum end
		end
	end
	if lum_bg > lum_fg then
		return (lum_bg + 0.05)/(lum_fg + 0.05)
	else
		return (lum_fg + 0.05)/(lum_bg + 0.05)
	end
end

--[[
Use {{#invoke:Color contrast|somecolor}} directly or
{{#invoke:Color contrast}} from a wrapper template.

Parameters:
	-- |1=	— required; A color to check.
--]]
function p.lum(frame)
	local color = frame.args[1] or frame:getParent().args[1]
	return p._lum(color)
end

function p.ratio(frame)
	local args = frame.args[1] and frame.args or frame:getParent().args
	return p._ratio(args)
end

function p.styleratio(frame)
	local args = frame.args[1] and frame.args or frame:getParent().args
	return p._styleratio(args)
end

function p.greatercontrast(frame)
	local args = frame.args[1] and frame.args or frame:getParent().args
	return p._greatercontrast(args)
end

return p
什么季节补钙效果最好 什么叫腺样体肥大 什么叫克隆 3.5是什么星座 神的国和神的义指的是什么
脾虚要吃什么东西调理 吃什么食物对头发好 鳊鱼是什么鱼 结肠炎挂什么科 排酸肉是什么意思
肺炎是什么原因引起的 插班生是什么意思 学是什么偏旁 什么牌子的充电宝好 什么是凤凰男
嗳气和打嗝有什么区别 秋葵什么时候播种 隐形眼镜没有护理液用什么代替 荡是什么意思 为什么不建议做冠脉cta检查
肋骨断了是什么感觉hcv7jop6ns6r.cn 化疗与放疗有什么区别hanqikai.com 什么血型是万能血型hcv9jop4ns6r.cn 总是饿是什么原因hcv8jop5ns9r.cn 女人能日到什么时候hcv9jop3ns2r.cn
什么是电子邮件地址hcv9jop3ns6r.cn swissmade是什么意思hcv7jop6ns0r.cn 过期牛奶可以做什么naasee.com 风疹吃什么药hcv8jop5ns1r.cn 什么的超市hcv8jop9ns8r.cn
血氧低有什么症状hcv8jop5ns2r.cn 多囊肾是什么意思0297y7.com 为什么叫关东军hcv9jop5ns1r.cn 口羊读什么hcv9jop1ns8r.cn 月经不调有什么症状hcv9jop5ns3r.cn
人这一生为了什么hcv8jop4ns2r.cn 多梦吃什么药效果最好hcv7jop5ns0r.cn 白菜属于什么科hcv9jop1ns6r.cn 宗人府是什么地方hcv9jop0ns3r.cn 不粘锅涂层是什么材料520myf.com
百度