Skip to content

Commit

Permalink
Merge pull request #19 from ChilliBits/beta
Browse files Browse the repository at this point in the history
Release to version 2.1.2
  • Loading branch information
marcauberer authored Apr 7, 2020
2 parents 4596a20 + 0879409 commit 4ec6f71
Show file tree
Hide file tree
Showing 58 changed files with 800 additions and 585 deletions.
2 changes: 1 addition & 1 deletion .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# These are supported funding model platforms

github: [mrgames13]
github: [marcauberer]
custom: ["https://www.paypal.me/marcauberer"]
3 changes: 3 additions & 0 deletions .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions .idea/dictionaries/I516467.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 29 additions & 0 deletions .idea/markdown-navigator-enh.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

55 changes: 55 additions & 0 deletions .idea/markdown-navigator.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 29 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
sudo: false
language: android
dist: trusty
android:
components:
- build-tools-29.0.3
- extra-google-google_play_services
- extra-google-m2repository
- extra-android-m2repository
- android-$ANDROID_EMULATOR_LEVEL
- sys-img-armeabi-v7a-google_apis-$ANDROID_EMULATOR_LEVEL
env:
global:
- ANDROID_API_LEVEL=26
- ANDROID_EMULATOR_LEVEL=24
- ANDROID_BUILD_TOOLS_VERSION=26.0.1
- ANDROID_ABI=armeabi-v7a
- ANDROID_TAG=google_apis
- ADB_INSTALL_TIMEOUT=20
before_install:
- chmod +x gradlew
licenses:
- '.+'
before_script:
- android list targets | grep -E '^id:' | awk -F '"' '{$1=""; print $2}'
- echo no | android create avd --force -n test -t "android-"$ANDROID_EMULATOR_LEVEL --abi $ANDROID_ABI --tag $ANDROID_TAG
- QEMU_AUDIO_DRV=none emulator -avd test -no-window &
- android-wait-for-emulator
- adb shell input keyevent 82 &
35 changes: 18 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,41 +1,42 @@
## Color Converter
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/cb98dbe7ca6d46af8b385dadd618c446)](https://app.codacy.com/gh/ChilliBits/color-converter?utm_source=github.com&utm_medium=referral&utm_content=ChilliBits/color-converter&utm_campaign=Badge_Grade_Dashboard)
[![Build Status](https://travis-ci.com/ChilliBits/color-converter.svg?branch=master)](https://travis-ci.com/ChilliBits/color-converter)

[![Codacy Badge](https://api.codacy.com/project/badge/Grade/cb98dbe7ca6d46af8b385dadd618c446)](https://app.codacy.com/gh/ChilliBits/color-converter?utm_source=github.com&utm_medium=referral&utm_content=ChilliBits/color-converter&utm_campaign=Badge_Grade_Dashboard)

Color Converter is an Android app to pick, display and convert colors.

Download Color Converter from Google Play: [https://play.google.com/store/apps/details?id=com.chillibits.colorconverter](https://play.google.com/store/apps/details?id=com.chillibits.colorconverter)
Download Color Converter from [Google Play](https://play.google.com/store/apps/details?id=com.mrgames13.jimdo.colorconverter)!

More info on our homepage: [https://chillibits.com/color-converter](https://chillibits.com/color-converter)
More info on our homepage: [https://chillibits.com/color-converter](https://chillibits.com/colorconverter)

## Features

- Pick colors
- Get name of picked colors
- Display picked colors in different formats (RGB, HEX, HSV)
- Generate random colors
- Pick color from a photo / image
- Save / load colors
- Pick colors
- Get name of picked colors
- Display picked colors in different formats (RGB, HEX, HSV)
- Generate random colors
- Pick color from a photo / image
- Save / load colors

## Screenshots (Android 10)
<img src="https://github.com/chillibits/color-converter/raw/master/screenshots/1.png" width="256" title="Screenshot 1"><img src="https://github.com/chillibits/color-converter/raw/master/screenshots/2.png" width="256" title="Screenshot 2"><img src="https://github.com/chillibits/color-converter/raw/master/screenshots/3.png" width="256" title="Screenshot 3"><img src="https://github.com/chillibits/color-converter/raw/master/screenshots/4.png" width="256" title="Screenshot 4"><img src="https://github.com/chillibits/color-converter/raw/master/screenshots/5.png" width="256" title="Screenshot 5"><img src="https://github.com/chillibits/color-converter/raw/master/screenshots/6.png" width="256" title="Screenshot 6">

## Contribute to this project
You can contribute to this project by doing following things:

- If you want to contribute new features, please fork this repository to your own GitHub account. Then build your awesome feature and post a pull request back to this repo. We will check your changes and merge your contribution asap.
- If you want to add a new translation language or improve an existing translation, please write an email to: [[email protected]](mailto:[email protected]&subject=Add%20translation)
- If you want to submit a request for a new feature, please also write an email to: [[email protected]](mailto:[email protected]&subject=Feature%20request)
- If you want to contribute new features, please fork this repository to your own GitHub account. Then build your awesome feature and post a pull request back to this repo. We will check your changes and merge your contribution asap.
- If you want to add a new translation language or improve an existing translation, please write an email to: [[email protected]](mailto:[email protected]&subject=Add%20translation)
- If you want to submit a request for a new feature, please also write an email to: [[email protected]](mailto:[email protected]&subject=Feature%20request)

## Used third party libraries

Thanks to following people:

- [Glide](https://github.com/bumptech/glide) by Bump Technologies
- [ColorPickerPreference](https://github.com/attenzione/android-ColorPickerPreference) by Sergey Margaritov
- [PixImagePicker](https://github.com/akshay2211/PixImagePicker) by Akshay Sharma
- [ColorPickerView](https://github.com/skydoves/ColorPickerView) by Jaewoong Eum
- [Glide](https://github.com/bumptech/glide) by Bump Technologies
- [ColorPickerPreference](https://github.com/attenzione/android-ColorPickerPreference) by Sergey Margaritov
- [PixImagePicker](https://github.com/akshay2211/PixImagePicker) by Akshay Sharma
- [ColorPickerView](https://github.com/skydoves/ColorPickerView) by Jaewoong Eum

Thanks to all contributers and translators!
Thanks to all contributors and translators!

© ChilliBits 2017-2020 (Designed and developed by Marc Auberer)
16 changes: 10 additions & 6 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ apply plugin: 'kotlin-android-extensions'

android {
compileSdkVersion 29
buildToolsVersion "29.0.2"
buildToolsVersion "29.0.3"
defaultConfig {
applicationId "com.mrgames13.jimdo.colorconverter"
minSdkVersion 19
targetSdkVersion 29
versionCode 211
versionName "2.1.1"
versionCode 212
versionName "2.1.2"
vectorDrawables.useSupportLibrary = true
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
Expand All @@ -37,16 +37,20 @@ dependencies {
// base dependencies
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.core:core-ktx:1.3.0-alpha01'
implementation 'androidx.core:core-ktx:1.3.0-beta01'
implementation 'androidx.constraintlayout:constraintlayout:2.0.0-beta4'
implementation 'com.google.android.instantapps:instantapps:1.1.0'
implementation 'com.google.android.play:core:1.6.5'
implementation 'com.google.android.play:core:1.7.2'
implementation 'androidx.palette:palette:1.0.0'
implementation 'com.google.android.material:material:1.1.0'
implementation 'net.margaritov.preference.colorpicker.ColorPickerPreference:ColorPickerPreference:1.0.0'
implementation 'com.github.bumptech.glide:glide:4.11.0'
implementation 'com.fxn769:pix:1.4.4'
implementation 'com.github.skydoves:colorpickerview:2.1.5'
implementation 'com.github.skydoves:colorpickerview:2.1.6'
implementation 'com.mikepenz:iconics-core:5.0.1'
implementation 'com.mikepenz:material-design-iconic-typeface:2.2.0.6-kotlin@aar'
implementation 'com.mikepenz:fastadapter:5.0.0'
implementation 'com.github.javiersantos:MaterialStyledDialogs:2.1'

// dependencies for testing
testImplementation 'junit:junit:4.13'
Expand Down
11 changes: 2 additions & 9 deletions app/src/main/java/com/chillibits/colorconverter/model/Color.kt
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,8 @@ class Color: Comparable<Color> {
if(creationTimestamp != -1L) this.creationTimestamp = creationTimestamp
}

constructor(id: Int, name: String, red: Int, green: Int, blue: Int, creationTimestamp: Long) {
this.id = id
this.name = name
this.color = android.graphics.Color.argb(255, red, green, blue)
this.red = red
this.green = green
this.blue = blue
if(creationTimestamp != -1L) this.creationTimestamp = creationTimestamp
}
constructor(id: Int, name: String, red: Int, green: Int, blue: Int, creationTimestamp: Long):
this(id, name, android.graphics.Color.argb(255, red, green, blue), creationTimestamp)

override fun compareTo(@NotNull other: Color): Int {
return other.creationTimestamp.compareTo(creationTimestamp)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@
package com.chillibits.colorconverter.tools

class ColorName(private var name: String, private var r: Int, private var g: Int, private var b: Int) {
fun computeMSE(pixR: Int, pixG: Int, pixB: Int): Int {
return ((pixR - r) * (pixR - r) + (pixG - g) * (pixG - g) + (pixB - b) * (pixB - b)) / 3
}

fun computeMSE(pixR: Int, pixG: Int, pixB: Int) =
((pixR - r) * (pixR - r) + (pixG - g) * (pixG - g) + (pixB - b) * (pixB - b)) / 3
fun getName(): String = name
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,8 @@ import android.content.Context
import com.chillibits.colorconverter.model.Color
import com.mrgames13.jimdo.colorconverter.R

class ColorNameTools(private val context: Context) {

class ColorNameTools(private val c: Context) {
private fun initColorList(): List<ColorName> {
val c = context
return mutableListOf(
ColorName(c.getString(R.string.color_alice_blue), 0xF0, 0xF8, 0xFF),
ColorName(c.getString(R.string.color_antique_white), 0xFA, 0xEB, 0xD7),
Expand Down Expand Up @@ -157,21 +155,18 @@ class ColorNameTools(private val context: Context) {
}

private fun getColorNameFromRgb(r: Int, g: Int, b: Int): String {
val colorList = initColorList()
var closestMatch: ColorName? = null
var minMSE = Int.MAX_VALUE
var mse: Int
for (c in colorList) {
mse = c.computeMSE(r, g, b)
for (color in initColorList()) {
mse = color.computeMSE(r, g, b)
if (mse < minMSE) {
minMSE = mse
closestMatch = c
closestMatch = color
}
}
return closestMatch?.getName() ?: "No color"
}

fun getColorNameFromColor(color: Color): String {
return getColorNameFromRgb(color.red, color.green, color.blue)
}
fun getColorNameFromColor(color: Color) = getColorNameFromRgb(color.red, color.green, color.blue)
}
Loading

0 comments on commit 4ec6f71

Please sign in to comment.