From 34d270aad8736bd6d5bba2667b9f777d352e361c Mon Sep 17 00:00:00 2001 From: KJlmfe Date: Tue, 14 Apr 2015 20:50:45 +0800 Subject: [PATCH 1/6] module style add strikeThrough and strikeThroughColor --- Examples/UIExplorer/TextExample.ios.js | 17 +++++++++++++++++ Libraries/Text/RCTShadowText.h | 2 ++ Libraries/Text/RCTShadowText.m | 10 ++++++++++ Libraries/Text/RCTTextManager.m | 2 ++ Libraries/Text/TextStylePropTypes.js | 4 ++++ React/Base/RCTConvert.h | 1 + React/Base/RCTConvert.m | 6 ++++++ 7 files changed, 42 insertions(+) diff --git a/Examples/UIExplorer/TextExample.ios.js b/Examples/UIExplorer/TextExample.ios.js index ebc67b672068ab..4c8626855711ce 100644 --- a/Examples/UIExplorer/TextExample.ios.js +++ b/Examples/UIExplorer/TextExample.ios.js @@ -176,6 +176,23 @@ exports.examples = [ ); }, +}, { + title: 'StrikeThrough', + render: function() { + return ( + + + None strikeThrough line + + + Single strikeThrough line + + + Double strikeThrough line with custom color + + + ); + }, }, { title: 'Nested', description: 'Nested text components will inherit the styles of their ' + diff --git a/Libraries/Text/RCTShadowText.h b/Libraries/Text/RCTShadowText.h index d156bb4d60a197..4bcf28dd8c04a1 100644 --- a/Libraries/Text/RCTShadowText.h +++ b/Libraries/Text/RCTShadowText.h @@ -27,6 +27,8 @@ extern NSString *const RCTReactTagAttributeName; @property (nonatomic, assign) NSTextAlignment textAlign; @property (nonatomic, strong) UIColor *textBackgroundColor; @property (nonatomic, assign) NSWritingDirection writingDirection; +@property (nonatomic, assign) NSUnderlineStyle strikeThrough; +@property (nonatomic, strong) UIColor *strikeThroughColor; - (void)recomputeText; diff --git a/Libraries/Text/RCTShadowText.m b/Libraries/Text/RCTShadowText.m index 65bee774e06e65..5eba84efb95d96 100644 --- a/Libraries/Text/RCTShadowText.m +++ b/Libraries/Text/RCTShadowText.m @@ -250,6 +250,14 @@ - (void)_setParagraphStyleOnAttributedString:(NSMutableAttributedString *)attrib value:paragraphStyle range:(NSRange){0, attributedString.length}]; } + + //line-through + self.strikeThrough = _strikeThrough ?: NSUnderlineStyleNone; + [self _addAttribute: NSStrikethroughStyleAttributeName withValue:[NSNumber numberWithInt:self.strikeThrough] toAttributedString:attributedString]; + if(_strikeThroughColor) { + [self _addAttribute: NSStrikethroughColorAttributeName withValue: _strikeThroughColor toAttributedString:attributedString]; + } + } - (void)fillCSSNode:(css_node_t *)node @@ -291,5 +299,7 @@ - (void)set##setProp:(type)value; \ RCT_TEXT_PROPERTY(TextAlign, _textAlign, NSTextAlignment) RCT_TEXT_PROPERTY(TextBackgroundColor, _textBackgroundColor, UIColor *) RCT_TEXT_PROPERTY(WritingDirection, _writingDirection, NSWritingDirection) +RCT_TEXT_PROPERTY(StrikeThrough, _strikeThrough, NSUnderlineStyle); +RCT_TEXT_PROPERTY(StrikeThroughColor, _strikeThroughColor, UIColor *); @end diff --git a/Libraries/Text/RCTTextManager.m b/Libraries/Text/RCTTextManager.m index 26c6329e2313ec..1c203e141f151d 100644 --- a/Libraries/Text/RCTTextManager.m +++ b/Libraries/Text/RCTTextManager.m @@ -40,6 +40,8 @@ - (RCTShadowView *)shadowView #pragma mark - Shadow properties RCT_EXPORT_SHADOW_PROPERTY(writingDirection, NSWritingDirection) +RCT_EXPORT_SHADOW_PROPERTY(strikeThrough, NSUnderlineStyle) +RCT_EXPORT_SHADOW_PROPERTY(strikeThroughColor, UIColor) RCT_EXPORT_SHADOW_PROPERTY(color, UIColor) RCT_EXPORT_SHADOW_PROPERTY(fontFamily, NSString) RCT_EXPORT_SHADOW_PROPERTY(fontSize, CGFloat) diff --git a/Libraries/Text/TextStylePropTypes.js b/Libraries/Text/TextStylePropTypes.js index 450d26f3378fa3..7c96eb2250e7a1 100644 --- a/Libraries/Text/TextStylePropTypes.js +++ b/Libraries/Text/TextStylePropTypes.js @@ -34,6 +34,10 @@ var TextStylePropTypes = Object.assign(Object.create(ViewStylePropTypes), { ['auto' /*default*/, 'ltr', 'rtl'] ), letterSpacing: ReactPropTypes.number, + strikeThrough:ReactPropTypes.oneOf( + ['none' /*default*/, 'single', 'double'] + ), + strikeThroughColor: ReactPropTypes.string }); // Text doesn't support padding correctly (#4841912) diff --git a/React/Base/RCTConvert.h b/React/Base/RCTConvert.h index 145e88b21bcbf4..128c618cf149b1 100644 --- a/React/Base/RCTConvert.h +++ b/React/Base/RCTConvert.h @@ -51,6 +51,7 @@ + (NSTimeInterval)NSTimeInterval:(id)json; + (NSTextAlignment)NSTextAlignment:(id)json; ++ (NSUnderlineStyle)NSUnderlineStyle:(id)json; + (NSWritingDirection)NSWritingDirection:(id)json; + (UITextAutocapitalizationType)UITextAutocapitalizationType:(id)json; + (UITextFieldViewMode)UITextFieldViewMode:(id)json; diff --git a/React/Base/RCTConvert.m b/React/Base/RCTConvert.m index 804faf87ece82b..da5679126b698f 100644 --- a/React/Base/RCTConvert.m +++ b/React/Base/RCTConvert.m @@ -202,6 +202,12 @@ + (NSDate *)NSDate:(id)json @"justify": @(NSTextAlignmentJustified), }), NSTextAlignmentNatural, integerValue) +RCT_ENUM_CONVERTER(NSUnderlineStyle, (@{ + @"none": @(NSUnderlineStyleNone), + @"single": @(NSUnderlineStyleSingle), + @"double": @(NSUnderlineStyleDouble), +}), NSUnderlineStyleNone, integerValue) + RCT_ENUM_CONVERTER(NSWritingDirection, (@{ @"auto": @(NSWritingDirectionNatural), @"ltr": @(NSWritingDirectionLeftToRight), From 1c9bd5c2f58799bc8a5699cf42f0eb45bf3660a7 Mon Sep 17 00:00:00 2001 From: KJlmfe Date: Wed, 15 Apr 2015 11:04:38 +0800 Subject: [PATCH 2/6] update module strikeThrough style to follow the text-decoration-style CSS naming convention --- Examples/UIExplorer/TextExample.ios.js | 10 ++++++++-- Libraries/Text/TextStylePropTypes.js | 2 +- React/Base/RCTConvert.m | 4 +++- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/Examples/UIExplorer/TextExample.ios.js b/Examples/UIExplorer/TextExample.ios.js index 4c8626855711ce..236ccc784e896f 100644 --- a/Examples/UIExplorer/TextExample.ios.js +++ b/Examples/UIExplorer/TextExample.ios.js @@ -184,12 +184,18 @@ exports.examples = [ None strikeThrough line - + Single strikeThrough line - + Double strikeThrough line with custom color + + Dashed strikeThrough line with custom color + + + Dotted strikeThrough line with custom color + ); }, diff --git a/Libraries/Text/TextStylePropTypes.js b/Libraries/Text/TextStylePropTypes.js index 7c96eb2250e7a1..794917f2863816 100644 --- a/Libraries/Text/TextStylePropTypes.js +++ b/Libraries/Text/TextStylePropTypes.js @@ -35,7 +35,7 @@ var TextStylePropTypes = Object.assign(Object.create(ViewStylePropTypes), { ), letterSpacing: ReactPropTypes.number, strikeThrough:ReactPropTypes.oneOf( - ['none' /*default*/, 'single', 'double'] + ['none' /*default*/, 'solid', 'double', 'dotted','dashed'] ), strikeThroughColor: ReactPropTypes.string }); diff --git a/React/Base/RCTConvert.m b/React/Base/RCTConvert.m index da5679126b698f..66da29dfd45f2c 100644 --- a/React/Base/RCTConvert.m +++ b/React/Base/RCTConvert.m @@ -204,8 +204,10 @@ + (NSDate *)NSDate:(id)json RCT_ENUM_CONVERTER(NSUnderlineStyle, (@{ @"none": @(NSUnderlineStyleNone), - @"single": @(NSUnderlineStyleSingle), + @"solid": @(NSUnderlineStyleSingle), @"double": @(NSUnderlineStyleDouble), + @"dotted": @(NSUnderlinePatternDot | NSUnderlineStyleSingle), + @"dashed": @(NSUnderlinePatternDash | NSUnderlineStyleSingle), }), NSUnderlineStyleNone, integerValue) RCT_ENUM_CONVERTER(NSWritingDirection, (@{ From 46dd1fc3fec72fe51326c3f0f35de70c27e30719 Mon Sep 17 00:00:00 2001 From: KJlmfe Date: Wed, 15 Apr 2015 11:31:59 +0800 Subject: [PATCH 3/6] change the UIExplorer Example for strikeThroughColor --- Examples/UIExplorer/TextExample.ios.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Examples/UIExplorer/TextExample.ios.js b/Examples/UIExplorer/TextExample.ios.js index 236ccc784e896f..19415e082ca1b3 100644 --- a/Examples/UIExplorer/TextExample.ios.js +++ b/Examples/UIExplorer/TextExample.ios.js @@ -187,13 +187,13 @@ exports.examples = [ Single strikeThrough line - + Double strikeThrough line with custom color Dashed strikeThrough line with custom color - + Dotted strikeThrough line with custom color From c6928df552ad4a30efbc0c1113800c24055703a8 Mon Sep 17 00:00:00 2001 From: KJlmfe Date: Wed, 17 Jun 2015 17:36:14 +0800 Subject: [PATCH 4/6] resolve conflict --- Examples/UIExplorer/TextExample.ios.js | 37 ++++++++++++++++++-------- Libraries/Text/RCTShadowText.h | 6 +++-- Libraries/Text/RCTShadowText.m | 23 +++++++++++----- Libraries/Text/RCTTextManager.m | 5 ++-- Libraries/Text/TextStylePropTypes.js | 9 ++++--- React/Base/RCTConvert.h | 3 +++ React/Base/RCTConvert.m | 10 +++++-- React/React.xcodeproj/project.pbxproj | 2 ++ React/Views/RCTTextDecorationType.h | 17 ++++++++++++ 9 files changed, 85 insertions(+), 27 deletions(-) create mode 100644 React/Views/RCTTextDecorationType.h diff --git a/Examples/UIExplorer/TextExample.ios.js b/Examples/UIExplorer/TextExample.ios.js index 19415e082ca1b3..7df9310d4a7757 100644 --- a/Examples/UIExplorer/TextExample.ios.js +++ b/Examples/UIExplorer/TextExample.ios.js @@ -177,25 +177,40 @@ exports.examples = [ ); }, }, { - title: 'StrikeThrough', + title: 'Text Decoration', render: function() { return ( - - None strikeThrough line + + Solid underline - - Single strikeThrough line + + Double underline line with custom color - - Double strikeThrough line with custom color + + Dashed underline with custom color - - Dashed strikeThrough line with custom color - - + Dotted strikeThrough line with custom color + + None textDecoration line + + + Solid line-through + + + Double line-through line with custom color + + + Dashed line-through with custom color + + + Dotted line-through line with custom color + + + Both underline and line-through + ); }, diff --git a/Libraries/Text/RCTShadowText.h b/Libraries/Text/RCTShadowText.h index 4bcf28dd8c04a1..ba3898b8c6ab26 100644 --- a/Libraries/Text/RCTShadowText.h +++ b/Libraries/Text/RCTShadowText.h @@ -8,6 +8,7 @@ */ #import "RCTShadowView.h" +#import "RCTTextDecorationType.h" extern NSString *const RCTIsHighlightedAttributeName; extern NSString *const RCTReactTagAttributeName; @@ -27,8 +28,9 @@ extern NSString *const RCTReactTagAttributeName; @property (nonatomic, assign) NSTextAlignment textAlign; @property (nonatomic, strong) UIColor *textBackgroundColor; @property (nonatomic, assign) NSWritingDirection writingDirection; -@property (nonatomic, assign) NSUnderlineStyle strikeThrough; -@property (nonatomic, strong) UIColor *strikeThroughColor; +@property (nonatomic, strong) UIColor *textDecorationColor; +@property (nonatomic, assign) NSUnderlineStyle textDecorationStyle; +@property (nonatomic, assign) RCTTextDecorationType textDecorationLine; - (void)recomputeText; diff --git a/Libraries/Text/RCTShadowText.m b/Libraries/Text/RCTShadowText.m index 5eba84efb95d96..9a24cfb9f1d52f 100644 --- a/Libraries/Text/RCTShadowText.m +++ b/Libraries/Text/RCTShadowText.m @@ -251,11 +251,19 @@ - (void)_setParagraphStyleOnAttributedString:(NSMutableAttributedString *)attrib range:(NSRange){0, attributedString.length}]; } - //line-through - self.strikeThrough = _strikeThrough ?: NSUnderlineStyleNone; - [self _addAttribute: NSStrikethroughStyleAttributeName withValue:[NSNumber numberWithInt:self.strikeThrough] toAttributedString:attributedString]; - if(_strikeThroughColor) { - [self _addAttribute: NSStrikethroughColorAttributeName withValue: _strikeThroughColor toAttributedString:attributedString]; + + //underline and line-through + _textDecorationStyle = _textDecorationStyle ? : NSUnderlineStyleSingle; + if(_textDecorationLine == RCTTextDecorationTypeUnderline || _textDecorationLine == RCTTextDecorationTypeUnderlineStrikethrough) { + [self _addAttribute: NSUnderlineStyleAttributeName withValue:[NSNumber numberWithInt:_textDecorationStyle] toAttributedString:attributedString]; + } + if(_textDecorationLine == RCTTextDecorationTypeStrikethrough || _textDecorationLine == RCTTextDecorationTypeUnderlineStrikethrough){ + [self _addAttribute: NSStrikethroughStyleAttributeName withValue:[NSNumber numberWithInt:_textDecorationStyle] toAttributedString:attributedString]; + } + + if(_textDecorationColor) { + [self _addAttribute: NSStrikethroughColorAttributeName withValue: _textDecorationColor toAttributedString:attributedString]; + [self _addAttribute: NSUnderlineColorAttributeName withValue: _textDecorationColor toAttributedString:attributedString]; } } @@ -299,7 +307,8 @@ - (void)set##setProp:(type)value; \ RCT_TEXT_PROPERTY(TextAlign, _textAlign, NSTextAlignment) RCT_TEXT_PROPERTY(TextBackgroundColor, _textBackgroundColor, UIColor *) RCT_TEXT_PROPERTY(WritingDirection, _writingDirection, NSWritingDirection) -RCT_TEXT_PROPERTY(StrikeThrough, _strikeThrough, NSUnderlineStyle); -RCT_TEXT_PROPERTY(StrikeThroughColor, _strikeThroughColor, UIColor *); +RCT_TEXT_PROPERTY(TextDecorationStyle, _textDecorationStyle, NSUnderlineStyle); +RCT_TEXT_PROPERTY(TextDecorationColor, _textDecorationColor, UIColor *); +RCT_TEXT_PROPERTY(TextDecorationLine, _textDecorationLine, RCTTextDecorationType); @end diff --git a/Libraries/Text/RCTTextManager.m b/Libraries/Text/RCTTextManager.m index 1c203e141f151d..a62803584a84e9 100644 --- a/Libraries/Text/RCTTextManager.m +++ b/Libraries/Text/RCTTextManager.m @@ -40,8 +40,9 @@ - (RCTShadowView *)shadowView #pragma mark - Shadow properties RCT_EXPORT_SHADOW_PROPERTY(writingDirection, NSWritingDirection) -RCT_EXPORT_SHADOW_PROPERTY(strikeThrough, NSUnderlineStyle) -RCT_EXPORT_SHADOW_PROPERTY(strikeThroughColor, UIColor) +RCT_EXPORT_SHADOW_PROPERTY(textDecorationStyle, NSUnderlineStyle) +RCT_EXPORT_SHADOW_PROPERTY(textDecorationColor, UIColor) +RCT_EXPORT_SHADOW_PROPERTY(textDecorationLine, RCTTextDecorationType) RCT_EXPORT_SHADOW_PROPERTY(color, UIColor) RCT_EXPORT_SHADOW_PROPERTY(fontFamily, NSString) RCT_EXPORT_SHADOW_PROPERTY(fontSize, CGFloat) diff --git a/Libraries/Text/TextStylePropTypes.js b/Libraries/Text/TextStylePropTypes.js index 794917f2863816..937faf5d3078c4 100644 --- a/Libraries/Text/TextStylePropTypes.js +++ b/Libraries/Text/TextStylePropTypes.js @@ -34,10 +34,13 @@ var TextStylePropTypes = Object.assign(Object.create(ViewStylePropTypes), { ['auto' /*default*/, 'ltr', 'rtl'] ), letterSpacing: ReactPropTypes.number, - strikeThrough:ReactPropTypes.oneOf( - ['none' /*default*/, 'solid', 'double', 'dotted','dashed'] + textDecorationLine:ReactPropTypes.oneOf( + ['none' /*default*/, 'underline', 'line-through', 'underline line-through'] ), - strikeThroughColor: ReactPropTypes.string + textDecorationStyle:ReactPropTypes.oneOf( + ['solid' /*default*/, 'double', 'dotted','dashed'] + ), + textDecorationColor: ReactPropTypes.string, }); // Text doesn't support padding correctly (#4841912) diff --git a/React/Base/RCTConvert.h b/React/Base/RCTConvert.h index 128c618cf149b1..5fbec622efbc3f 100644 --- a/React/Base/RCTConvert.h +++ b/React/Base/RCTConvert.h @@ -12,10 +12,12 @@ #import "Layout.h" #import "RCTAnimationType.h" +#import "RCTTextDecorationType.h" #import "RCTDefines.h" #import "RCTLog.h" #import "RCTPointerEvents.h" + /** * This class provides a collection of conversion functions for mapping * JSON objects to native types and classes. These are useful when writing @@ -121,6 +123,7 @@ typedef BOOL css_clip_t; + (RCTPointerEvents)RCTPointerEvents:(id)json; + (RCTAnimationType)RCTAnimationType:(id)json; ++ (RCTTextDecorationType)RCTTextDecorationType:(id)json; @end diff --git a/React/Base/RCTConvert.m b/React/Base/RCTConvert.m index 66da29dfd45f2c..772af7d91acc80 100644 --- a/React/Base/RCTConvert.m +++ b/React/Base/RCTConvert.m @@ -203,12 +203,18 @@ + (NSDate *)NSDate:(id)json }), NSTextAlignmentNatural, integerValue) RCT_ENUM_CONVERTER(NSUnderlineStyle, (@{ - @"none": @(NSUnderlineStyleNone), @"solid": @(NSUnderlineStyleSingle), @"double": @(NSUnderlineStyleDouble), @"dotted": @(NSUnderlinePatternDot | NSUnderlineStyleSingle), @"dashed": @(NSUnderlinePatternDash | NSUnderlineStyleSingle), -}), NSUnderlineStyleNone, integerValue) +}), NSUnderlineStyleSingle, integerValue) + +RCT_ENUM_CONVERTER(RCTTextDecorationType, (@{ + @"none": @(RCTTextDecorationTypeNone), + @"underline": @(RCTTextDecorationTypeUnderline), + @"line-through": @(RCTTextDecorationTypeStrikethrough), + @"underline line-through": @(RCTTextDecorationTypeUnderlineStrikethrough), +}), RCTTextDecorationTypeNone, integerValue) RCT_ENUM_CONVERTER(NSWritingDirection, (@{ @"auto": @(NSWritingDirectionNatural), diff --git a/React/React.xcodeproj/project.pbxproj b/React/React.xcodeproj/project.pbxproj index 81f65d39ac2084..b47839ecd49544 100644 --- a/React/React.xcodeproj/project.pbxproj +++ b/React/React.xcodeproj/project.pbxproj @@ -226,6 +226,7 @@ 83CBBA971A6020BB00E9B192 /* RCTTouchHandler.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTTouchHandler.m; sourceTree = ""; }; 83CBBACA1A6023D300E9B192 /* RCTConvert.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTConvert.h; sourceTree = ""; }; 83CBBACB1A6023D300E9B192 /* RCTConvert.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTConvert.m; sourceTree = ""; }; + E3BBC8EB1ADE6F47001BBD81 /* RCTTextDecorationType.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RCTTextDecorationType.h; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -361,6 +362,7 @@ 13B080241A694A8400A75B9A /* RCTWrapperViewController.m */, 13E067531A70F44B002CDEE1 /* UIView+React.h */, 13E067541A70F44B002CDEE1 /* UIView+React.m */, + E3BBC8EB1ADE6F47001BBD81 /* RCTTextDecorationType.h */, ); path = Views; sourceTree = ""; diff --git a/React/Views/RCTTextDecorationType.h b/React/Views/RCTTextDecorationType.h new file mode 100644 index 00000000000000..ba10eb99e1a5fe --- /dev/null +++ b/React/Views/RCTTextDecorationType.h @@ -0,0 +1,17 @@ +/** + * Copyright (c) 2015-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ + +#import + +typedef NS_ENUM(NSInteger, RCTTextDecorationType) { + RCTTextDecorationTypeNone = 0, + RCTTextDecorationTypeUnderline, + RCTTextDecorationTypeStrikethrough, + RCTTextDecorationTypeUnderlineStrikethrough, +}; From dbea8e1b34cce511950737120a42eb6302e0e503 Mon Sep 17 00:00:00 2001 From: KJlmfe Date: Wed, 15 Apr 2015 20:14:16 +0800 Subject: [PATCH 5/6] Fix typo in Examples/UIExplorer/TextExample.ios.js --- Examples/UIExplorer/TextExample.ios.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Examples/UIExplorer/TextExample.ios.js b/Examples/UIExplorer/TextExample.ios.js index 7df9310d4a7757..83647bc4750646 100644 --- a/Examples/UIExplorer/TextExample.ios.js +++ b/Examples/UIExplorer/TextExample.ios.js @@ -191,7 +191,7 @@ exports.examples = [ Dashed underline with custom color - Dotted strikeThrough line with custom color + Dotted underline line with custom color None textDecoration line From 81f4cb625481caaa705303c9e980910899771ae7 Mon Sep 17 00:00:00 2001 From: KJlmfe Date: Wed, 15 Apr 2015 20:46:03 +0800 Subject: [PATCH 6/6] Also fix typo in Examples/UIExplorer/TextExample.ios.js --- Examples/UIExplorer/TextExample.ios.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Examples/UIExplorer/TextExample.ios.js b/Examples/UIExplorer/TextExample.ios.js index 83647bc4750646..5dad4e638efd94 100644 --- a/Examples/UIExplorer/TextExample.ios.js +++ b/Examples/UIExplorer/TextExample.ios.js @@ -185,28 +185,28 @@ exports.examples = [ Solid underline - Double underline line with custom color + Double underline with custom color Dashed underline with custom color - Dotted underline line with custom color + Dotted underline with custom color - None textDecoration line + None textDecoration Solid line-through - Double line-through line with custom color + Double line-through with custom color Dashed line-through with custom color - Dotted line-through line with custom color + Dotted line-through with custom color Both underline and line-through