private bool SetStyleValue(StylePropertyId id, StyleColor inlineValue, StyleColor sharedValue) { var sv = new StyleValue(); if (TryGetStyleValue(id, ref sv)) { if (sv.color == inlineValue.value && sv.keyword == inlineValue.keyword) { return(false); } } else if (inlineValue.keyword == StyleKeyword.Null) { return(false); } sv.id = id; sv.keyword = inlineValue.keyword; sv.color = inlineValue.value; SetStyleValue(sv); if (inlineValue.keyword == StyleKeyword.Null) { sv.keyword = sharedValue.keyword; sv.color = sharedValue.value; } ApplyStyleValue(sv); return(true); }
private bool SetInlineStyle(StylePropertyID id, StyleColor inlineValue, StyleColor sharedValue) { var sv = new StyleValue(); if (TryGetInlineStyleValue(id, ref sv)) { if (sv.color == inlineValue.value && sv.keyword == inlineValue.keyword) { return(false); } } sv.id = id; sv.keyword = inlineValue.keyword; sv.color = inlineValue.value; SetInlineStyle(sv); int specificity = StyleValueExtensions.InlineSpecificity; if (inlineValue.keyword == StyleKeyword.Null) { specificity = sharedValue.specificity; sv.keyword = sharedValue.keyword; sv.color = sharedValue.value; } ApplyStyleValue(sv, specificity); return(true); }
public StyleColor GetStyleColor(StylePropertyId id) { StyleValue styleValue = default(StyleValue); bool flag = this.TryGetStyleValue(id, ref styleValue); StyleColor result; if (flag) { result = new StyleColor(styleValue.color, styleValue.keyword); } else { result = StyleKeyword.Null; } return(result); }
public override bool Equals(object obj) { bool flag = !(obj is StyleColor); bool result; if (flag) { result = false; } else { StyleColor lhs = (StyleColor)obj; result = (lhs == this); } return(result); }
public bool Equals(StyleColor other) { return(other == this); }
public static bool operator==(StyleColor lhs, Color rhs) { var styleColor = new StyleColor(rhs); return(lhs == styleColor); }
public static bool operator ==(StyleColor lhs, Color rhs) { StyleColor rhs2 = new StyleColor(rhs); return(lhs == rhs2); }
public StyleColor(StyleKeyword keyword) { this = new StyleColor(Color.clear, keyword); }
public StyleColor(Color v) { this = new StyleColor(v, StyleKeyword.Undefined); }