public void ApplyColor(StyleSheet sheet, StyleValueHandle[] handles, int specificity, ref StyleColor property) { property.Apply(new StyleColor(currentStyleValue.color, currentStyleValue.keyword) { specificity = specificity }, StylePropertyApplyMode.Copy); }
public void Apply(VisualElementStylesData other, StylePropertyApplyMode mode) { // Always just copy the reference to custom properties, since they can't be overriden per instance m_CustomProperties = other.m_CustomProperties; width.Apply(other.width, mode); height.Apply(other.height, mode); maxWidth.Apply(other.maxWidth, mode); maxHeight.Apply(other.maxHeight, mode); minWidth.Apply(other.minWidth, mode); minHeight.Apply(other.minHeight, mode); flexBasis.Apply(other.flexBasis, mode); flexGrow.Apply(other.flexGrow, mode); flexShrink.Apply(other.flexShrink, mode); overflow.Apply(other.overflow, mode); unityOverflowClipBox.Apply(other.unityOverflowClipBox, mode); left.Apply(other.left, mode); top.Apply(other.top, mode); right.Apply(other.right, mode); bottom.Apply(other.bottom, mode); marginLeft.Apply(other.marginLeft, mode); marginTop.Apply(other.marginTop, mode); marginRight.Apply(other.marginRight, mode); marginBottom.Apply(other.marginBottom, mode); paddingLeft.Apply(other.paddingLeft, mode); paddingTop.Apply(other.paddingTop, mode); paddingRight.Apply(other.paddingRight, mode); paddingBottom.Apply(other.paddingBottom, mode); position.Apply(other.position, mode); alignSelf.Apply(other.alignSelf, mode); unityTextAlign.Apply(other.unityTextAlign, mode); unityFontStyleAndWeight.Apply(other.unityFontStyleAndWeight, mode); fontSize.Apply(other.fontSize, mode); unityFont.Apply(other.unityFont, mode); whiteSpace.Apply(other.whiteSpace, mode); color.Apply(other.color, mode); flexDirection.Apply(other.flexDirection, mode); backgroundColor.Apply(other.backgroundColor, mode); backgroundImage.Apply(other.backgroundImage, mode); unityBackgroundScaleMode.Apply(other.unityBackgroundScaleMode, mode); unityBackgroundImageTintColor.Apply(other.unityBackgroundImageTintColor, mode); alignItems.Apply(other.alignItems, mode); alignContent.Apply(other.alignContent, mode); justifyContent.Apply(other.justifyContent, mode); flexWrap.Apply(other.flexWrap, mode); borderLeftColor.Apply(other.borderLeftColor, mode); borderTopColor.Apply(other.borderTopColor, mode); borderRightColor.Apply(other.borderRightColor, mode); borderBottomColor.Apply(other.borderBottomColor, mode); borderLeftWidth.Apply(other.borderLeftWidth, mode); borderTopWidth.Apply(other.borderTopWidth, mode); borderRightWidth.Apply(other.borderRightWidth, mode); borderBottomWidth.Apply(other.borderBottomWidth, mode); borderTopLeftRadius.Apply(other.borderTopLeftRadius, mode); borderTopRightRadius.Apply(other.borderTopRightRadius, mode); borderBottomRightRadius.Apply(other.borderBottomRightRadius, mode); borderBottomLeftRadius.Apply(other.borderBottomLeftRadius, mode); unitySliceLeft.Apply(other.unitySliceLeft, mode); unitySliceTop.Apply(other.unitySliceTop, mode); unitySliceRight.Apply(other.unitySliceRight, mode); unitySliceBottom.Apply(other.unitySliceBottom, mode); opacity.Apply(other.opacity, mode); cursor.Apply(other.cursor, mode); visibility.Apply(other.visibility, mode); display.Apply(other.display, mode); }
public void ApplyColor(StyleSheet sheet, StyleValueHandle[] handles, int specificity, ref StyleColor property) { var value = sheet.ReadStyleColor(handles[0], specificity); property.Apply(value, StylePropertyApplyMode.CopyIfEqualOrGreaterSpecificity); }