All Projects → Elenionl → Easydarkmode

Elenionl / Easydarkmode

Licence: mit
This is a tool for developers to easily adapt dark mode in iOS 13.

Projects that are alternatives of or similar to Easydarkmode

Cypress Dark
Dark and Halloween color themes for Cypress.io test runner
Stars: ✭ 94 (-26.56%)
Mutual labels:  dark-theme
Slack Dark Mojave Theme
Beautiful dark theme for slack 3, 4+. Apply theme by running one command 🌸
Stars: ✭ 107 (-16.41%)
Mutual labels:  dark-theme
Metro For Discord
Make your Discord client look like a UWP app.
Stars: ✭ 109 (-14.84%)
Mutual labels:  dark-theme
Firefox Uwp Style
MDL2 Theme for Firefox
Stars: ✭ 96 (-25%)
Mutual labels:  dark-theme
React Darkreader
🌓 A React Hook for adding a dark / night mode to your site.
Stars: ✭ 104 (-18.75%)
Mutual labels:  dark-theme
Github Dark
Dark GitHub style
Stars: ✭ 9,479 (+7305.47%)
Mutual labels:  dark-theme
Telegram
🧛🏻‍♂️ Dark theme for Telegram Desktop
Stars: ✭ 92 (-28.12%)
Mutual labels:  dark-theme
Flutter news app
A Simple News App built with Flutter.
Stars: ✭ 117 (-8.59%)
Mutual labels:  dark-theme
Zxtheme
使用MethodSwizzling实现零侵入修改全局主题,无需修改项目旧代码,可随时添加、移除,可快速实现“暗黑模式(黑暗模式、深色模式、换肤)”,兼容xib与纯代码创建的view,兼容所有控件(含第三方控件)
Stars: ✭ 106 (-17.19%)
Mutual labels:  dark-theme
Biaui
WPF dark theme and controls for .NET Core and .NET Framework
Stars: ✭ 109 (-14.84%)
Mutual labels:  dark-theme
Nightwind
An automatic, customisable, overridable Tailwind dark mode plugin
Stars: ✭ 98 (-23.44%)
Mutual labels:  dark-theme
Nimbus Theme
The best dark theme for Emacs
Stars: ✭ 102 (-20.31%)
Mutual labels:  dark-theme
Darkreader
Dark Reader Chrome and Firefox extension
Stars: ✭ 12,052 (+9315.63%)
Mutual labels:  dark-theme
Covid 19 Tracker
Android app to track COVID-19 cases in India and globally.
Stars: ✭ 96 (-25%)
Mutual labels:  dark-theme
Jekyll Theme Yat
🎨 Yet another theme for elegant writers with modern flat style and beautiful night/dark mode.
Stars: ✭ 113 (-11.72%)
Mutual labels:  dark-theme
Notion Icons 2.0
Create a more vibrant and modern workspace. Use Github Issues to request more Icons.
Stars: ✭ 93 (-27.34%)
Mutual labels:  dark-theme
Halcyon Vscode
A dark blue theme for VS Code based on the Ayu Mirage theme
Stars: ✭ 108 (-15.62%)
Mutual labels:  dark-theme
Hydrangea Vim
Hydrangea theme for Vim.
Stars: ✭ 121 (-5.47%)
Mutual labels:  dark-theme
Discord Panel
📊 User friendly dashboard/tool for discord bot developpers to manage servers
Stars: ✭ 116 (-9.37%)
Mutual labels:  dark-theme
St Theme Freesia
Freesia theme for Sublime Text 3. (Unmaintained.)
Stars: ✭ 108 (-15.62%)
Mutual labels:  dark-theme

EasyDarkMode

version license platform Swfit Objective-C

Introduction

iOS 13 introduces user interface feature. This feature contains two kinds of user interface types, light and dark.

This project is a tool for developers to easily adapt user interface feature in iOS 13.

Star if you like it.

Samples

video

light

dark

Integrate with Cocoapods

Use this firm to find podfile script for your project.

Firstly, choose according to the language used in your project (Swift/Objective-C).

Secondly, choose according to whether you are using network image (Local image/Others).

Then, if you are using network image, choose the download method you preferred (SDWebImage/Kingfisher/Custom download method).

Podfile script Objective-C Swift Local image SDWebImage Kingfisher Custom download
pod 'EasyDarkMode' or pod 'EasyDarkMode/Core'
pod 'EasyDarkMode/Core-Swift'
pod 'EasyDarkMode/SDWebImage'
pod 'EasyDarkMode/SDWebImage+Swift'
pod 'EasyDarkMode/Kingfisher'
pod 'EasyDarkMode/Remote'
pod 'EasyDarkMode/Remote-Swift'

How to use

Create color with different user interface

  • Swift

Included in pod 'EasyDarkMode/Core-Swift'

import EasyDarkMode

view.backgroundColor = UIColor.dm.color(white:UIColor.black , dark: UIColor.white)
  • Objective-C

Included in pod 'EasyDarkMode/Core'

#import <EasyDarkMode/EasyDarkMode.h>

view.backgroundColor = [UIColor dm_colorWithColorLight:UIColor.grayColor dark:UIColor.whiteColor];

Create image from local with different user interface

  • Swift

Included in pod 'EasyDarkMode/Core-Swift'

import EasyDarkMode

imageView.image = UIImage.dm.image(name: "check_light", dark: "check_dark")
  • Objective-C

Included in pod 'EasyDarkMode/Core'

#import <EasyDarkMode/EasyDarkMode.h>

imageView.image = [UIImage dm_imageWithNameLight:@"check_light" dark:@""check_dark""];

Create image from SDWebImage with different user interface

  • Swift

Included in pod 'EasyDarkMode/SDWebImage+Swift'

import EasyDarkMode
// You should config downloder once before start to download images.
DMDownloadManager.shared.connectWithSdWebImage()
// ...
item.dm.setImage(pathString: "http://img.mp.itc.cn/upload/20160525/73e975795bf94f82baf43315f89a30b1_th.jpg", dark: "http://img.mp.itc.cn/upload/20160525/5d6588b3c928495a9ee0eb2b0b672936_th.jpg", for: UIControl.State.normal)
  • Objective-C

Included in pod 'EasyDarkMode/SDWebImage'

#import <EasyDarkMode/EasyDrakMode.h>
// You should config downloder once before start to download images.
[DMDownloadManager.shared connectWithSdWebImage];
// ...
[button dm_setImagePathStringLight:@"http://img.mp.itc.cn/upload/20160525/73e975795bf94f82baf43315f89a30b1_th.jpg" dark:@"http://img.mp.itc.cn/upload/20160525/5d6588b3c928495a9ee0eb2b0b672936_th.jpg" forState:UIControlStateNnormal];

Create image from Kingfisher with different user interface

  • Swift

Included in pod 'EasyDarkMode/Kingfisher'

import EasyDarkMode
// You should config downloder once before start to download images.
DMDownloadManager.shared.connectWithKingfisher()
// ...
item.dm.setImage(pathString: "http://img.mp.itc.cn/upload/20160525/73e975795bf94f82baf43315f89a30b1_th.jpg", dark: "http://img.mp.itc.cn/upload/20160525/5d6588b3c928495a9ee0eb2b0b672936_th.jpg", for: UIControl.State.normal)

Create image from custom download method with different user interface

  • Swift

Included in pod 'EasyDarkMode/Remote-Swift'

import EasyDarkMode
// You should config downloder once before start to download images.
DMDownloadManager.shared.downloader = { (url, completion) in
    // ...
}
// ...
item.dm.setImage(pathString: "http://img.mp.itc.cn/upload/20160525/73e975795bf94f82baf43315f89a30b1_th.jpg", dark: "http://img.mp.itc.cn/upload/20160525/5d6588b3c928495a9ee0eb2b0b672936_th.jpg", for: UIControl.State.normal)
  • Objective-C

Included in pod 'EasyDarkMode/Remote'

#import <EasyDarkMode/EasyDrakMode.h>
// You should config downloder once before start to download images.
DMDownloadManager.shared.downloader = ^(NSURL * _Nonnull data, DMDownloadHandler  _Nonnull completion) {
    // ...
}
// ...
[button dm_setImagePathStringLight:@"http://img.mp.itc.cn/upload/20160525/73e975795bf94f82baf43315f89a30b1_th.jpg" dark:@"http://img.mp.itc.cn/upload/20160525/5d6588b3c928495a9ee0eb2b0b672936_th.jpg" forState:UIControlStateNnormal];

Features

  • Shortcut method to create UIColor with different user interface type.

  • Shortcut method to create UIImage with different user interface type.

  • Written in Objective-C. All functions available in Swift with modern APIs.

  • Shortcut method to download remoate image with SDWebImage and Kingfisher and create UIImage with different user interface type.

  • This code can work on from Xcode 9 to Xcode 11.

  • It has an various deployment target version from iOS 8 to iOS 13.

  • We found that enable appearence image set in xcassets leads to dramatic lagging in application startup. Some walkaround like combine images into one UIImage object manually is necessory, if you are working with a giant application.

TODO

[●] Support UIImage/UIColor

[●] Support SDWebImage

[●] Support KingFisher.

[○] Find a way to support NSTextAttachment in NSAttributedString.

[○] Find a way to support web image for NSTextAttachment.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].