diff options
author | kdx <kikoodx@paranoici.org> | 2024-03-15 17:41:01 +0100 |
---|---|---|
committer | kdx <kikoodx@paranoici.org> | 2024-03-15 17:41:01 +0100 |
commit | d2c10b2e05d567c34c071e8845d23a8f9a0b50d3 (patch) | |
tree | 32d7f011dfe23c1bf785e4a76a848e3b57adfca7 | |
parent | 4f63c6b7ff2de61fd08fbc7c6d73ceda11dfeb2f (diff) | |
download | maximalistmanifesto-d2c10b2e05d567c34c071e8845d23a8f9a0b50d3.tar.gz |
fix colors
-rw-r--r-- | map/0.tmj | 6 | ||||
-rwxr-xr-x | run.sh | 2 | ||||
-rw-r--r-- | src/_color.c | 1 | ||||
-rw-r--r-- | src/color.c | 8 | ||||
-rw-r--r-- | src/entity.c | 2 | ||||
-rw-r--r-- | src/trigger.c | 8 |
6 files changed, 17 insertions, 10 deletions
@@ -790,6 +790,12 @@ "name":"color", "type":"color", "value":"#ff00eaff" + }, + { + "name":"color group", + "propertytype":"ColorGroup", + "type":"int", + "value":0 }], "rotation":0, "type":"color", @@ -1,2 +1,2 @@ #!/bin/sh -tup build-default && gamescope -Fpixel -w480 -h360 -- ./build-default/build/nulltopos . +tup build-default && gamescope -Fpixel -w480 -h360 -- ./build-default/build/nulltopos . && killall nulltopos -9 diff --git a/src/_color.c b/src/_color.c index a7573fe..2f3c7cf 100644 --- a/src/_color.c +++ b/src/_color.c @@ -11,6 +11,7 @@ void setbgcolor(float r, float g, float b) { _br = r; _bg = g; _bb = b; + plog("%f %f %f", _br, _bg, _bb); } void fgcolor() { diff --git a/src/color.c b/src/color.c index 8f5b71b..67c3fb8 100644 --- a/src/color.c +++ b/src/color.c @@ -3,9 +3,9 @@ PARENT(trigger); IMPL(enter) { if (this->color_group) - setfgcolor(1. / 255. * this->color.r, 1. / 255. * this->color.g, - 1. / 255. * this->color.b); + setfgcolor(this->color.r / 255., this->color.g / 255., + this->color.b / 255.); else - setbgcolor(1. / 255. * this->color.r, 1. / 255. * this->color.g, - 1. / 255. * this->color.b); + setbgcolor(this->color.r / 255., this->color.g / 255., + this->color.b / 255.); } diff --git a/src/entity.c b/src/entity.c index 5f81cda..8076a86 100644 --- a/src/entity.c +++ b/src/entity.c @@ -245,5 +245,5 @@ const char *entity_propertyc(Entity *this, const char *property) { return e->valuestring; } } - return "#000000ff"; + return "#ff000000"; } diff --git a/src/trigger.c b/src/trigger.c index 987b7f9..7790d9d 100644 --- a/src/trigger.c +++ b/src/trigger.c @@ -17,10 +17,10 @@ INIT { const auto color = propertyc("color"); if (color != nullptr && strlen(color) > 8) { - this->color.r = strtobyte(color + 1); - this->color.g = strtobyte(color + 3); - this->color.b = strtobyte(color + 5); - this->color.a = strtobyte(color + 7); + this->color.r = strtobyte(color + 3); + this->color.g = strtobyte(color + 5); + this->color.b = strtobyte(color + 7); + this->color.a = strtobyte(color + 1); } else { this->color.r = 0; this->color.g = 0; |