PrettyColors v1.0.0 Release Notes

Release Date: 2015-02-02 // almost 7 years ago
  • 🔄 Changelog

    Conform Color.Wrap to MutableCollectionType.

    Conform Color.Wrap to ArrayLiteralConvertable.

    Conform Color.Wrap to Equality.

    let one: Color.Wrap = [StyleParameter.Bold]let two: [StyleParameter.Bold] as Color.WrapXCTAssert( one == two )
    

    ✂ Remove Color.Wrap.add and SelectGraphicRenditionWrapType.add.

    Previously:

    Color.Wrap.add and SelectGraphicRenditionWrapType.add do not mutate their struct. They return a SelectGraphicRenditionWrapType value.

    let red = Color.Wrap(foreground: .Red) red.add(parameters: .Bold) // =\> SelectGraphicRenditionWrapType valueXCTAssert( red == Color.Wrap(foreground: .Red) )XCTAssert( red != Color.Wrap(foreground: .Red, style: .Bold) )
    
    var red = Color.Wrap(foreground: .Red) red.add(parameters: .Bold) // =\> SelectGraphicRenditionWrapType valueXCTAssert( red == Color.Wrap(foreground: .Red) )XCTAssert( red != Color.Wrap(foreground: .Red, style: .Bold) )
    

    As of 1.0.0:

    let red = Color.Wrap(foreground: .Red) red + Color.Wrap(styles: .Bold) // =\> Color.Wrap value// red.append(style: .Bold) /\* prevented by compiler… \*/XCTAssert( red == Color.Wrap(foreground: .Red) )XCTAssert( red != Color.Wrap(foreground: .Red, style: .Bold) )
    
    var red = Color.Wrap(foreground: .Red) red.append(style: .Bold) // =\> ()XCTAssert( red != Color.Wrap(foreground: .Red) )XCTAssert( red == Color.Wrap(foreground: .Red, style: .Bold) )
    

    More examples of the new syntax can be found in the tests….

    Conform Color.Wrap to Equality.

    0️⃣ Default to Array Equality, but add option of Set Equality.

    Example

    let one = Color.Wrap(styles: .Bold, .Italic)let two = Color.Wrap(styles: .Italic, .Bold)XCTAssert( !(one == two) )XCTAssert( one != two )XCTAssert( one.isEqual(to: two, equality: .Set) )XCTAssert( !one.isEqual(to: two, equality: .Array) )
    

    Semantic Versioning

    Going forward, PrettyColors will follow Semantic Versioning: http://semver.org.

    Thanks

    MutableCollectionType conformance based off code from brynbellomy/SwiftDataStructures and brynbellomy/Funky.

    Thanks to @brynbellomy