mirror of
https://github.com/zhuzichu520/FluentUI.git
synced 2025-07-05 17:55:25 +08:00
update
This commit is contained in:
@ -197,23 +197,14 @@ Rectangle {
|
||||
}
|
||||
|
||||
function _hsla(h, s, b, a) {
|
||||
if(!enableAlphaChannel){
|
||||
a = 1
|
||||
}
|
||||
var lightness = (2 - s)*b
|
||||
var satHSL = s*b/((lightness <= 1) ? lightness : 2 - lightness)
|
||||
lightness /= 2
|
||||
|
||||
var c = Qt.hsla(h, satHSL, lightness, a)
|
||||
|
||||
colorChanged(c)
|
||||
|
||||
return c
|
||||
}
|
||||
|
||||
function _rgb(rgb, a) {
|
||||
|
||||
var c = Qt.rgba(rgb.r, rgb.g, rgb.b, a)
|
||||
|
||||
colorChanged(c)
|
||||
|
||||
return c
|
||||
}
|
||||
|
||||
|
@ -11,6 +11,7 @@ Button{
|
||||
implicitWidth: width
|
||||
implicitHeight: height
|
||||
property alias colorValue: container.colorValue
|
||||
property alias enableAlphaChannel: container.enableAlphaChannel
|
||||
background:
|
||||
Rectangle{
|
||||
id:layout_color
|
||||
@ -27,7 +28,7 @@ Button{
|
||||
anchors.fill: parent
|
||||
anchors.margins: 4
|
||||
radius: 5
|
||||
color: container.colorValue
|
||||
color: control.colorValue
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -6,6 +6,7 @@ import "ColorPicker"
|
||||
Item {
|
||||
id:control
|
||||
property alias colorValue: color_picker.colorValue
|
||||
property alias enableAlphaChannel: color_picker.enableAlphaChannel
|
||||
property int radius: 5
|
||||
width: color_picker.width+10
|
||||
height: color_picker.height
|
||||
|
Reference in New Issue
Block a user