Home
last modified time | relevance | path

Searched refs:colorStr (Results 1 – 15 of 15) sorted by relevance

/foundation/windowmanager/wm/src/
Dcolor_parser.cpp27 bool ColorParser::Parse(const std::string& colorStr, uint32_t& colorValue) in Parse() argument
29 if (colorStr.empty()) { in Parse()
34 if (colorStr[0] == '#') { // start with '#' in Parse()
35 std::string color = colorStr.substr(1); in Parse()
41 if (colorStr.size() == 7) { // #RRGGBB: RRGGBB -> AARRGGBB in Parse()
44 } else if (colorStr.size() == 9) { // #AARRGGBB in Parse()
53 bool ColorParser::IsValidHexString(const std::string& colorStr) in IsValidHexString() argument
55 if (colorStr.empty()) { in IsValidHexString()
58 for (char ch : colorStr) { in IsValidHexString()
/foundation/ace/ace_engine/frameworks/core/components/common/properties/
Dcolor.cpp52 Color Color::FromString(std::string colorStr, uint32_t maskAlpha) in FromString() argument
54 if (colorStr.empty()) { in FromString()
60 colorStr.erase(std::remove(colorStr.begin(), colorStr.end(), ' '), colorStr.end()); in FromString()
64 if (std::regex_match(colorStr, matches, COLOR_WITH_MAGIC)) { in FromString()
65 colorStr.erase(0, 1); in FromString()
66 auto value = stoul(colorStr, nullptr, COLOR_STRING_BASE); in FromString()
67 if (colorStr.length() < COLOR_STRING_SIZE_STANDARD) { in FromString()
74 if (std::regex_match(colorStr, matches, COLOR_WITH_MAGIC_MINI)) { in FromString()
75 colorStr.erase(0, 1); in FromString()
78 for (auto& c : colorStr) { in FromString()
[all …]
Dcolor.h59 static Color FromString(std::string colorStr, uint32_t maskAlpha = COLOR_ALPHA_MASK);
/foundation/windowmanager/wm/include/
Dcolor_parser.h25 static bool Parse(const std::string& colorStr, uint32_t& colorValue);
28 static bool IsValidHexString(const std::string& colorStr);
/foundation/ace/ace_engine_lite/frameworks/src/core/components/test/unittest/common/
Dtext_tdd_exception_test.cpp37 const char* colorStr = "color"; in ComponentTextStyleSetExceptionTest007() local
38 jerry_value_t textKey = jerry_create_string((const jerry_char_t*)colorStr); in ComponentTextStyleSetExceptionTest007()
Dslider_tdd_test.cpp172 const char* colorStr = "color"; in ComponentSliderStyleSetColorTest004() local
173 jerry_value_t textKey = jerry_create_string((const jerry_char_t*)colorStr); in ComponentSliderStyleSetColorTest004()
194 UpdateNumAttributeOrStyleValue(sliderComponent, colorStr, expectColorValue2, false); in ComponentSliderStyleSetColorTest004()
207 UpdateNumAttributeOrStyleValue(sliderComponent, colorStr, expectColorValue3, false); in ComponentSliderStyleSetColorTest004()
220 UpdateCharAttributeOrStyleValue(sliderComponent, colorStr, exceptionColorStrValue, false); in ComponentSliderStyleSetColorTest004()
Dtext_tdd_test.cpp92 const char* colorStr = "color"; in ComponentTextStyleSetColorTest002() local
93 jerry_value_t textKey = jerry_create_string((const jerry_char_t*)colorStr); in ComponentTextStyleSetColorTest002()
118 UpdateNumAttributeOrStyleValue(textComponent, colorStr, expectColorValue2, false); in ComponentTextStyleSetColorTest002()
130 UpdateNumAttributeOrStyleValue(textComponent, colorStr, expectColorValue3, false); in ComponentTextStyleSetColorTest002()
/foundation/windowmanager/interfaces/kits/napi/window_runtime/window_napi/
Djs_window_utils.cpp322 std::string colorStr; in GetColorFromJs() local
323 if (!ConvertFromJsValue(engine, jsColor, colorStr)) { in GetColorFromJs()
328 if (!std::regex_match(colorStr, pattern)) { in GetColorFromJs()
332 WLOGFI("origin color: %{public}s", colorStr.c_str()); in GetColorFromJs()
333 std::string color = colorStr.substr(1); in GetColorFromJs()
/foundation/ace/ace_engine/frameworks/bridge/declarative_frontend/jsview/
Djs_canvas_renderer.cpp435 std::string colorStr = ""; in JsSetFillStyle() local
436 JSViewAbstract::ParseJsString(info[0], colorStr); in JsSetFillStyle()
437 auto color = Color::FromString(colorStr); in JsSetFillStyle()
487 std::string colorStr = ""; in JsSetStrokeStyle() local
488 JSViewAbstract::ParseJsString(info[0], colorStr); in JsSetStrokeStyle()
489 auto color = Color::FromString(colorStr); in JsSetStrokeStyle()
1100 std::string colorStr = ""; in JsSetShadowColor() local
1101 JSViewAbstract::ParseJsString(info[0], colorStr); in JsSetShadowColor()
1102 auto color = Color::FromString(colorStr); in JsSetShadowColor()
/foundation/ace/ace_engine/frameworks/bridge/js_frontend/engine/v8/
Dv8_offscreen_canvas_bridge.cpp417 v8::String::Utf8Value colorStr(isolate, args[1]->ToString(context).ToLocalChecked()); in AddColorStop() local
418 if (*colorStr) { in AddColorStop()
419 color.SetColor(Color::FromString(*colorStr)); in AddColorStop()
1808 v8::String::Utf8Value colorStr(isolate, value->ToString(context).ToLocalChecked()); in FillStyleSetter() local
1809 if (*colorStr) { in FillStyleSetter()
1810 auto color = Color::FromString(*colorStr); in FillStyleSetter()
1866 v8::String::Utf8Value colorStr(isolate, value->ToString(context).ToLocalChecked()); in StrokeStyleSetter() local
1867 if (*colorStr) { in StrokeStyleSetter()
1868 auto color = Color::FromString(*colorStr); in StrokeStyleSetter()
2287 v8::String::Utf8Value colorStr(isolate, value->ToString(context).ToLocalChecked()); in ShadowColorSetter() local
[all …]
Dv8_canvas_bridge.cpp493 v8::String::Utf8Value colorStr(isolate, args[1]->ToString(context).ToLocalChecked()); in AddColorStop() local
494 if (*colorStr) { in AddColorStop()
495 color.SetColor(Color::FromString(*colorStr)); in AddColorStop()
1914 v8::String::Utf8Value colorStr(isolate, value->ToString(context).ToLocalChecked()); in FillStyleSetter() local
1915 if (*colorStr) { in FillStyleSetter()
1916 auto color = Color::FromString(*colorStr); in FillStyleSetter()
1962 v8::String::Utf8Value colorStr(isolate, value->ToString(context).ToLocalChecked()); in StrokeStyleSetter() local
1963 if (*colorStr) { in StrokeStyleSetter()
1964 auto color = Color::FromString(*colorStr); in StrokeStyleSetter()
2354 v8::String::Utf8Value colorStr(isolate, value->ToString(context).ToLocalChecked()); in ShadowColorSetter() local
[all …]
/foundation/ace/ace_engine/frameworks/bridge/js_frontend/engine/jsi/
Djsi_offscreen_canvas_bridge.cpp1610 auto colorStr = proto->ToString(runtime); in JsFillStyleSetter() local
1611 auto color = Color::FromString(colorStr); in JsFillStyleSetter()
1660 auto colorStr = proto->ToString(runtime); in JsStrokeStyleSetter() local
1661 auto color = Color::FromString(colorStr); in JsStrokeStyleSetter()
2035 auto colorStr = proto->ToString(runtime); in JsShadowColorSetter() local
2036 auto color = Color::FromString(colorStr); in JsShadowColorSetter()
Djsi_canvas_bridge.cpp1995 auto colorStr = proto->ToString(runtime); in JsFillStyleSetter() local
1996 auto color = Color::FromString(colorStr); in JsFillStyleSetter()
2035 auto colorStr = proto->ToString(runtime); in JsStrokeStyleSetter() local
2036 auto color = Color::FromString(colorStr); in JsStrokeStyleSetter()
2380 auto colorStr = proto->ToString(runtime); in JsShadowColorSetter() local
2381 auto color = Color::FromString(colorStr); in JsShadowColorSetter()
/foundation/ace/ace_engine/frameworks/bridge/js_frontend/engine/quickjs/
Dcanvas_bridge.cpp1697 auto colorStr = JS_ToCString(ctx, proto); in JsHandleStyleSetter() local
1698 auto color = Color::FromString(colorStr); in JsHandleStyleSetter()
1709 JS_FreeCString(ctx, colorStr); in JsHandleStyleSetter()
1988 ScopedString colorStr(ctx, proto); in JsShadowColorSetter() local
1989 auto color = Color::FromString(colorStr.get()); in JsShadowColorSetter()
Doffscreen_canvas_bridge.cpp1516 auto colorStr = JS_ToCString(ctx, proto); in JsHandleStyleSetter() local
1517 auto color = Color::FromString(colorStr); in JsHandleStyleSetter()
1530 JS_FreeCString(ctx, colorStr); in JsHandleStyleSetter()
1838 ScopedString colorStr(ctx, proto); in JsShadowColorSetter() local
1839 auto color = Color::FromString(colorStr.get()); in JsShadowColorSetter()