/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*/
// EXTERNAL INCLUDES
+#include <dali/devel-api/object/handle-devel.h>
#include <dali-toolkit/dali-toolkit.h>
#include <iostream>
{
}
- void operator()(Vector4& current, const PropertyInputContainer& inputs )
+ void operator()(Vector3& current, const PropertyInputContainer& inputs )
{
- current = hsv2rgb(Vector4(inputs[0]->GetFloat(), saturation, value, current.a));
+ current = hsv2rgb(Vector3(inputs[0]->GetFloat(), saturation, value));
}
- Vector4 hsv2rgb(Vector4 colorHSV)
+ Vector3 hsv2rgb(Vector3 colorHSV)
{
float r=colorHSV.z*(1+colorHSV.y*(cos(colorHSV.x)-1));
float g=colorHSV.z*(1+colorHSV.y*(cos(colorHSV.x-2.09439)-1));
float b=colorHSV.z*(1+colorHSV.y*(cos(colorHSV.x+2.09439)-1));
- return Vector4(r, g, b, colorHSV.a);
+ return Vector3(r, g, b);
}
float hue;
float saturation;
TextLabelExample( Application& application )
: mApplication( application ),
+ mLabel(),
+ mContainer(),
+ mGrabCorner(),
+ mPanGestureDetector(),
+ mLayoutSize(),
mLanguageId( 0u ),
- mAlignment( 0u )
+ mAlignment( 0u ),
+ mHueAngleIndex( Property::INVALID_INDEX ),
+ mOverrideMixColorIndex( Property::INVALID_INDEX )
{
// Connect to the Application's Init signal
mApplication.InitSignal().Connect( this, &TextLabelExample::Create );
mHueAngleIndex = mLabel.RegisterProperty( "hue", 0.0f );
Renderer bgRenderer = mLabel.GetRendererAt(0);
- mOverrideMixColorIndex = bgRenderer.GetPropertyIndex( ColorVisual::Property::MIX_COLOR );
+ mOverrideMixColorIndex = DevelHandle::GetPropertyIndex( bgRenderer, ColorVisual::Property::MIX_COLOR );
- Constraint constraint = Constraint::New<Vector4>( bgRenderer, mOverrideMixColorIndex, HSVColorConstraint(0.0f, 0.5f, 0.8f));
+ Constraint constraint = Constraint::New<Vector3>( bgRenderer, mOverrideMixColorIndex, HSVColorConstraint(0.0f, 0.5f, 0.8f));
constraint.AddSource( Source( mLabel, mHueAngleIndex ) );
constraint.SetRemoveAction( Constraint::Discard );
constraint.Apply();