Linear color fix

This commit is contained in:
barsdeveloper
2022-09-07 22:17:14 +02:00
parent 610d6cfdd2
commit 9d424809c9
15 changed files with 88 additions and 63 deletions

View File

@@ -45,13 +45,13 @@ export default class Configuration {
static nodeRadius = 8 // in pixel
static nodeReflowEventName = "ueb-node-reflow"
static pinColor = {
bool: css`117, 0, 0`, // #750000
default: css`167, 167, 167`, // #a7a7a7
exec: css`167, 167, 167`, // #a7a7a7
name: css`203, 129, 252`, // #cb81fc
real: css`50, 187, 0`, // #32bb00
string: css`213, 0, 176`, // #d500b0
struct: css`3, 76, 168` // #034ca8
"bool": css`117, 0, 0`, // #750000
"default": css`167, 167, 167`, // #a7a7a7
"exec": css`167, 167, 167`, // #a7a7a7
"name": css`203, 129, 252`, // #cb81fc
"real": css`50, 187, 0`, // #32bb00
"string": css`213, 0, 176`, // #d500b0
"/Script/CoreUObject.LinearColor": css`3, 76, 168` // #034ca8
}
static selectAllKeyboardKey = "(bCtrl=True,Key=A)"
static trackingMouseEventName = {

View File

@@ -30,9 +30,7 @@ export default class PinElement extends IElement {
"name": NamePinTemplate,
"real": RealPinTemplate,
"string": StringPinTemplate,
"struct": {
"/Script/CoreUObject.LinearColor": LinearColorPinTemplate,
}
"/Script/CoreUObject.LinearColor": LinearColorPinTemplate,
}
static properties = {
@@ -51,6 +49,7 @@ export default class PinElement extends IElement {
return Utility.printLinearColor(value)
},
},
attribute: "data-color",
reflect: true,
},
defaultValue: {
@@ -81,9 +80,6 @@ export default class PinElement extends IElement {
*/
static getTypeTemplate(pinEntity) {
let result = PinElement.#typeTemplateMap[pinEntity.getType()]
if (result.constructor === Object) {
result = result[pinEntity.getSubCategory()]
}
return result ?? PinTemplate
}

View File

@@ -1,3 +1,4 @@
import Utility from "../Utility"
import IEntity from "./IEntity"
export default class LinearColorEntity extends IEntity {
@@ -8,4 +9,8 @@ export default class LinearColorEntity extends IEntity {
B: Number,
A: Number,
}
toString() {
return Utility.printLinearColor(this)
}
}

View File

@@ -104,16 +104,13 @@ export default class PinEntity extends IEntity {
}
getType() {
if (this.PinType.PinCategory == "struct") {
return this.PinType.PinSubCategoryObject.path
}
return this.PinType.PinCategory
}
getSubCategory() {
return this.PinType.PinSubCategoryObject.path
}
getColorValue() {
if (this.PinType.PinSubCategoryObject.path == "/Script/CoreUObject.LinearColor") {
}
}
}

View File

@@ -32,13 +32,13 @@ export default class BlueprintTemplate extends ITemplate {
"--ueb-grid-size": `${Configuration.gridSize}px`,
"--ueb-link-min-width": `${Configuration.linkMinWidth}`,
"--ueb-node-radius": `${Configuration.nodeRadius}px`,
"--ueb-pin-bool-color": `${Configuration.pinColor.bool}`,
"--ueb-pin-default-color": `${Configuration.pinColor.default}`,
"--ueb-pin-exec-color": `${Configuration.pinColor.exec}`,
"--ueb-pin-name-color": `${Configuration.pinColor.name}`,
"--ueb-pin-real-color": `${Configuration.pinColor.real}`,
"--ueb-pin-string-color": `${Configuration.pinColor.string}`,
"--ueb-pin-struct-color": `${Configuration.pinColor.struct}`,
"--ueb-pin-bool-color": `${Configuration.pinColor["bool"]}`,
"--ueb-pin-default-color": `${Configuration.pinColor["default"]}`,
"--ueb-pin-exec-color": `${Configuration.pinColor["exec"]}`,
"--ueb-pin-name-color": `${Configuration.pinColor["name"]}`,
"--ueb-pin-real-color": `${Configuration.pinColor["real"]}`,
"--ueb-pin-string-color": `${Configuration.pinColor["string"]}`,
"--ueb-pin-linear-color": `${Configuration.pinColor["/Script/CoreUObject.LinearColor"]}`,
}
/**

View File

@@ -40,7 +40,12 @@ export default class LinearColorPinTemplate extends IInputPinTemplate {
renderInput(pin) {
if (pin.isInput()) {
return html`
<span class="ueb-pin-input" data-linear-color="${pin.defaultValue.toString()}"></span>
<span
class="ueb-pin-input"
data-linear-color="${pin.defaultValue.toString()}"
style="--ueb-linear-color:rgba(${pin.defaultValue.toString()})"
>
</span>
`
}
return super.renderInput(pin)