Skip to content

Instantly share code, notes, and snippets.

@stephsharp
stephsharp / README.md
Last active October 24, 2022 03:00
Sample code for Stack Overflow question about using a single colour swatch in a Shopify theme (http://stackoverflow.com/questions/18978460/color-swatch-variant-dropdown-list-for-shopify-products)

This is for a Stack Overflow question about using colour swatches in a Shopify theme. It modifies the code provided in this tutorial on the Shopify wiki to only display one swatch that changes color depending on the selected option.

Related links:

#import <UIKit/UIKit.h>
@interface UIImage (Tint)
- (UIImage *)translucentImageWithAlpha:(CGFloat)alpha;
- (UIImage *)tintedGradientImageWithColor:(UIColor *)tintColor;
- (UIImage *)tintedImageWithColor:(UIColor *)tintColor;
@end
@stephsharp
stephsharp / UIImage+Tint.h
Last active August 29, 2017 19:32
UIImage+Tint
//
// UIImage+Tint.h
// Created by Stephanie Sharp on 5/03/2014.
//
#import <UIKit/UIKit.h>
@interface UIImage (Tint)
- (UIImage *)translucentImageWithAlpha:(CGFloat)alpha;
#import <UIKit/UIKit.h>
IB_DESIGNABLE
@interface FlatButton : UIButton
@property (nonatomic, getter=isFilled) IBInspectable BOOL filled;
@property (nonatomic) IBInspectable CGFloat cornerRadius;
@property (nonatomic) IBInspectable CGFloat borderWidth;