parseColor
Definition
-- @/lua/common/utils.lua:76
function parseColor(v)
if type(v) == 'table' then
return color(v.r, v.g, v.b, v.a)
elseif type(v) == 'string' and string.len(v) > 7 and v:sub(1,1) == '#' then
v = v:gsub("#","")
return color(tonumber("0x"..v:sub(1,2)), tonumber("0x"..v:sub(3,4)), tonumber("0x"..v:sub(5,6)), tonumber("0x"..v:sub(7,8)))
elseif v == nil then
return color(0,0,0,0)
end
end
Callers
@/lua/common/jbeam/sections/meshs.lua
local function parseColor(v)
if v == nil then
local color = ColorF(0, 0, 0, 0)
if prop.lightColor then color = parseColor(prop.lightColor) end
@/ui/lib/ext/angular-material/angular-material.js
rippleSizeSetting = element.attr('md-ripple-size'),
color = parseColor(element.attr('md-ink-ripple')) || parseColor(options.colorElement.length && $window.getComputedStyle(options.colorElement[0]).color || 'rgb(0, 0, 0)');
rippleSizeSetting = element.attr('md-ripple-size'),
color = parseColor(element.attr('md-ink-ripple')) || parseColor(options.colorElement.length && $window.getComputedStyle(options.colorElement[0]).color || 'rgb(0, 0, 0)');
function parseColor(color) {
if (!color) return;
color = parseColor(element.attr('md-ink-ripple')) || parseColor($window.getComputedStyle(options.colorElement[0]).color || 'rgb(0, 0, 0)');
color = parseColor(element.attr('md-ink-ripple')) || parseColor($window.getComputedStyle(options.colorElement[0]).color || 'rgb(0, 0, 0)');
@/lua/vehicle/bdebugImpl.lua
if node.highlight then
local col = parseColor(node.highlight.col or node.highlight.color)
local r,g,b,a = colorGetRGBA(col)
if beam.highlight then
local col = parseColor(beam.highlight.col or beam.highlight.color)
local r,g,b,a = colorGetRGBA(col)