[android] return color string values in the [0-255] range

This commit is contained in:
Łukasz Paczos
2019-03-26 12:49:33 +01:00
committed by Łukasz Paczos
parent 4224b89a9c
commit b21f9f3e35
15 changed files with 68 additions and 79 deletions

View File

@@ -25,18 +25,7 @@ Result<jni::Local<jni::Object<>>> Converter<jni::Local<jni::Object<>>, std::stri
}
Result<jni::Local<jni::Object<>>> Converter<jni::Local<jni::Object<>>, Color>::operator()(jni::JNIEnv& env, const Color& value) const {
std::string result;
result.reserve(32);
result += "rgba(";
result += util::toString(value.r);
result += ", ";
result += util::toString(value.g);
result += ", ";
result += util::toString(value.b);
result += ", ";
result += util::toString(value.a);
result += ")";
return jni::Make<jni::String>(env, result);
return jni::Make<jni::String>(env, value.stringify());
}
Result<jni::Local<jni::Object<>>> Converter<jni::Local<jni::Object<>>, style::expression::Formatted>::operator()(jni::JNIEnv& env, const style::expression::Formatted& value) const {