fed是什么意思| 樟脑丸是干什么的| 什么叫克隆| 风什么浪什么| 肠胃不好适合喝什么茶| 鹦鹉鱼能和什么鱼混养| 71年猪是什么命| 表白送什么花| 劲头是什么意思| 二次元是什么| 心态好是什么意思| 感冒没胃口吃什么好| 做梦梦到老公出轨代表什么预兆| 塔塔粉是什么粉| 婴儿吓着了有什么症状| 咪咪头疼是什么原因| 淋球菌是什么| 出国用什么翻译软件好| 怀疑心梗做什么检查| 拔牙第二天可以吃什么| 气血两亏是什么意思| 小腹胀痛什么原因| 眼镜框什么材质的好| 上颌窦炎吃什么药| 负荆请罪的负是什么意思| 149是什么意思| 怀孕血压高对胎儿有什么影响| 舌头上长泡是什么原因| 什么的李子| 地狱不空誓不成佛是什么意思| 鱼丸是什么做的| 迷失自我是什么意思| 6月19日是什么日子| 为什么心会痛| 马牛羊鸡犬豕中的豕指的是什么| 荸荠读音是什么| 黄体酮低吃什么补得快| 胆汁是什么颜色| 蚂蚁的触角有什么作用| 什么是备皮| 肚脐周围疼痛是什么原因| 生目念什么| 肩周炎属于什么科室| 三省吾身是什么意思| 结膜炎吃什么消炎药| 女生白带是什么| 什么是天眼| 至多是什么意思| 医保编码是什么| 64年的龙是什么命| cns医学上是什么意思| 骨加后念什么| 车牌颜色代表什么| 95年属什么生肖| 莫名是什么意思| 茶减一笔是什么字| 龋齿是什么| ost是什么| 此生不换什么意思| 吃软不吃硬是什么生肖| 香港车牌号是什么样子| 一个牙一个合是什么字| 苏打水配什么好喝| 肠胀气是什么原因引起的怎么解决| 厂与什么有关| 狗咬了不能吃什么| 姨妈痛吃什么药| 牛皮癣用什么药膏最好| 开铲车需要什么证件| 525什么星座| asia是什么意思| 军长什么级别| 吃什么好排大便| 神经损伤吃什么药| 劳苦功高是什么意思| 情人果是什么| 大脑记忆力下降是什么原因| 6月23日是什么星座| 扁平息肉属于什么性质| 数字9像什么| 农历和阳历有什么区别| 梦见狗咬人是什么预兆| 出挑是什么意思| 一什么湖面| 秦始皇叫什么名字| 幻觉是什么意思| 什么的坐着| 膀胱炎有什么症状| 1996年是属什么生肖| 女孩叫锦什么好听| 久而久之下一句是什么| 火为什么没有影子| 小孩包皮挂什么科| 吧可以组什么词| 李讷为什么不姓毛| 锁骨中间的窝叫什么| 公安局是干什么的| 孕妇缺营养吃什么补| 海军蓝是什么颜色| 眼睛上火吃什么药| 长瘊子是什么原因| 琼瑶是什么意思| 什么药可以流产| 花是植物的什么器官| 绿色洋桔梗花语是什么| olayks是什么牌子| ut是什么意思| 膝关节退行性改变是什么意思| 沉香是什么| 怀孕分泌物是什么样的| 谷维素是治疗什么的| 小本创业做什么生意好| 11月9日是什么日子| yuri是什么意思| 势不可挡是什么意思| 望尘莫及的及是什么意思| 猪八戒原名叫什么| 什么钻进风箱里两头受气| 926是什么星座| yp是什么| 扶她是什么| 为什么人会打嗝| 白玉蜗牛吃什么| 中指戴戒指什么意思| 八纲辨证中的八纲是什么| 什么的饭菜| vr间隙是什么意思| 血压低什么原因造成的| 唐僧代表什么生肖| 无意间是什么意思| 肝胃不和是什么意思| 指甲看什么科| 牙疼吃什么食物| 梅花开在什么季节| 重金属是什么| 捞面条配什么菜好吃| 什么山峻岭| 阴道是什么样的| 碱性磷酸酶高是什么原因| 煤气是什么气体| 大便前面硬后面稀是什么原因| 青黛色是什么颜色| 外阴瘙痒用什么药好| 梦见大山是什么预兆| 荔枝对身体有什么好处| 苡字取名寓意是什么| 小鱼际发红预示着什么| 海虫草是什么| 1882年属什么生肖| 婚检女性检查什么项目| 胎心监护是检查什么| twin什么意思| 扔枕头有什么忌讳吗| ic是什么意思| 天珠是什么| 吃什么可以补黑色素| 板蓝根长什么样| 护理专业出来能干什么| 今天吃什么菜好呢| 等位基因是什么| 同房出血是什么原因| 什么是会车| 胃胀腹胀吃什么药| 七月二号是什么日子| 乙肝看什么指标| 籍贯一般填什么| 胆结石什么原因引起的| 喉咙有痰是什么原因引起的| 色觉异常是什么意思| 乳腺导管局限性扩张是什么意思| 什么是乳腺结节| 哺乳期可以吃什么水果| 吃什么受孕率又快又高| 伏天从什么时候开始| 怜香惜玉是什么意思| 皂基是什么| 白带过氧化氢阳性是什么意思| 继发性不孕是什么意思| 流清鼻涕吃什么药| 今年26岁属什么生肖| 为什么总是莫名其妙的想哭| 刘三姐是什么生肖| 间质瘤是什么性质的瘤| 血小板压积是什么意思| 马粟是什么| 髋关节积液是什么原因造成的| 什么是木乃伊| 七月十三日是什么日子| 什么叫宿根太阳花| 发烧感冒挂什么科室| aj是什么鞋子| 阳虚和阴虚有什么区别| 百雀羚适合什么年龄段| 七月属什么生肖| 1970年属狗的是什么命| 甲醛是什么东西| 次第花开是什么意思| 七月初八是什么星座| 小孩舌头白是什么原因| 市检察长是什么级别| 眉头有痣代表什么意思| 农历9月28日是什么星座| 备孕吃什么水果| 樵夫是什么意思| 梦见茄子是什么意思| 钛是什么颜色| 梦见打台球是什么意思| 狡兔三窟是什么生肖| 人为什么会发热| 风凉话是什么意思| 泳字五行属什么| 两个土念什么字| 感冒为什么会鼻塞| 蔬菜沙拉都放什么菜| 阴道感染用什么药| 朱迅是什么民族| 拉屎是绿色的是什么原因| 牙齿一碰就疼是什么原因| 属羊的跟什么属相犯冲| 小孩舌头白是什么原因| 1月13日什么星座| 肠系膜淋巴结是什么病| 做喉镜挂什么科| chanel什么牌子| 吃什么对肾好| 什么的元帅| 西湖醋鱼是什么鱼| 周吴郑王是什么意思| 女人大姨妈来了吃什么最好| 老枞水仙属于什么茶| 如初是什么意思| 恶露是什么样子的图片| 莲蓬吃了有什么好处| emba是什么意思| 女人在什么时候最容易怀孕| 什么花是蓝色的| 沵是什么意思| 梦女是什么意思| 金价下跌意味着什么| 全身发烫但不发烧是什么原因| 合肥以前叫什么| 异曲同工是什么意思| 耄耋什么意思| 金是什么生肖| 杭盖是什么意思| 有病是什么意思| 脚肿是什么原因引起的| 防中暑喝什么水| 京东什么时候优惠最大| 雪莲果什么时候成熟| 眼干是什么原因引起的| 明天是什么节日| 肌电图挂什么科| 女生排卵期是什么意思| 紫癜有什么症状| 羊白是什么| 夏天什么时候结束| cb是什么| 高密度脂蛋白胆固醇是什么意思| 肝火吃什么药| 盗窃是什么意思| 联通查流量发什么短信| 浙江大学什么专业最好| 福利院是干什么的| 百度Jump to content

走近低调的“单车猎人”:让共享单车回归共享

Kuchokera ku Wikipedia
百度 此外,“意见”还要求加大惩戒力度,凡是拒绝或变相拒绝职工办理住房公积金贷款的,一经查实,将责令限期整改,拒不整改的记入企业信用档案,同时,利用南京市“七日双公开”信息采集平台导入“信用中国网”,将相关单位列入严重失信类黑名单。

Documentation for this module may be created at Module: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 'white'
	local v2 = color2lum(c2)
	local c3 = args[3] or 'black'
	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
黑豆有什么功效和作用 传染病四项挂什么科 肾出问题了有什么症状 避孕套和安全套有什么区别 coo是什么
明眸皓齿是什么意思 蓝莓有什么功效与作用 神经官能症是什么 挑染是什么意思 王加几念什么
女性胆固醇高吃什么 舒张压偏高是什么原因 扁桃体结石有什么症状 女人什么时候性欲最强 卧蚕是什么意思
淋巴细胞高是什么原因 小便多是什么原因 润物细无声是什么意思 争奇斗艳是什么意思 乳腺结节应该挂什么科
婚车头车一般用什么车hcv9jop0ns1r.cn 寒湿重吃什么中成药hcv9jop1ns1r.cn 活性炭是什么96micro.com 女人喜欢什么礼物fenrenren.com 空腹胰岛素高是什么原因hcv9jop5ns6r.cn
半夜饿了吃什么不长胖naasee.com 黑色皮肤适合什么颜色的衣服hcv7jop7ns1r.cn s标志的运动鞋是什么牌子hcv8jop3ns2r.cn 隔空是什么意思qingzhougame.com 月经安全期是什么时候hcv7jop6ns1r.cn
前列腺炎是什么原因引起hebeidezhi.com 胃酸想吐是什么原因hcv8jop5ns1r.cn 屁股后面骨头疼是什么原因hcv9jop2ns1r.cn 龘读什么hcv8jop5ns4r.cn 为什么一喝酒就拉肚子hcv9jop3ns5r.cn
冠心病什么症状hcv8jop5ns1r.cn 老百姓是什么意思hcv9jop0ns5r.cn 山芋是什么hcv8jop4ns6r.cn 生殖细胞是什么hcv8jop4ns9r.cn 肝郁吃什么药onlinewuye.com
百度